Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Fast Serialization code follow up
 

Pages: 1
LLBLGen Pro Runtime Framework
Fast Serialization code follow up
Page:1/1 

  Print all messages in this thread  
Poster Message
simmotech
User



Location:

Joined on:
01-Feb-2006 15:43:00
Posted:
1006 posts
# Posted on: 12-Jan-2007 07:28:41.  
Due to unforseen circumstances, I don't have the time currently to write an article or detailed instructions for using the current fast serialization code I have. Or even to merge it in to the latest released version.

What I have created though is a ZIP file containing the current code and a copy of the original file/template from which they were created where there was one.
Frans is planning to incorporate a version of this code in v2.1 and so it will eventually be converted for all the other flavours/combinations but I only have NET2.0/C#/Adapter code.

This should be enough to allow anyone who is keen enough to diff the original/new files and work out what I have changed/added (mainly added to no backwards compatibility problems) and incorporate them into a *copy* of any LLBLGen Runtime source library and compile.

Notes:
To switch on Fast Serialization, you just need to set
SerializationHelper.Optimization = SerializationOptimization.Fast
early at startup time.

By default, ObjectIDs are not preserved during through the serialization/deserialization cycle - any inter-entity references will automatically generate a new ID as required. This saves around 15% in size.
However, if you need to preserve the ObjectIDs to be able to match them back to existing entities, just set
SerializationHelper.PreserveObjectIDs = true

I have just added a minimally tested option for byte compression. By setting SerializationHelper.Compressor = new XXX() where XXX supports IByteCompressor or IMemoryStreamByteCompressor, the fast serializer/deserializer will compress/decompress the serialized data at the appropriate time.
By using an interface to support compression, you can plug in any compression utility external to the LLBLGen runtime library.
It should be easy to incorporate .NET 2.0s compression tools but I just haven't got round to it yet so I have included MiniLZO.cs as a sample but be aware that the majority of this code is not mine and is bound by the GNU General public Licence v2. Also it is 'unsafe' code for speed.

Please be aware that the code I have will be passed to Solutions Design at some point and so what is eventually included in v2.1 may be completely different to the attached code.

Cheers
Simon
  Top
mihies
User



Location:
Nova Gorica, Slovenia
Joined on:
29-Jan-2006 16:00:15
Posted:
799 posts
# Posted on: 12-Jan-2007 10:03:43.  
This looks like a very very good feature. Thanks for sharing.

Miha Markic
MVP C#, LLBLGenPro Partner, DXSquad
Blog, Twitter
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37866 posts
# Posted on: 12-Jan-2007 10:53:17.  
Forgot to approve the attachment again. THe attachment is now approved and available. Regular Smiley (click the paperclip in the topicstartpost)
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
acradyn
User



Location:
New York, NY
Joined on:
03-Apr-2004 17:38:43
Posted:
57 posts
# Posted on: 18-Jan-2007 00:08:39.  
SimmoTech, thanks for sharing this! I'll let you know if I can get it working and how much it helps!

  Top
mikeg22
User



Location:

Joined on:
30-Jun-2005 20:09:32
Posted:
411 posts
# Posted on: 18-Jan-2007 07:02:20.  
Whats the best way to get remoting to use this? Just run
Code:
SerializationHelper.Optimization = SerializationOptimization.Fast

on both client and server?
  Top
simmotech
User



Location:

Joined on:
01-Feb-2006 15:43:00
Posted:
1006 posts
# Posted on: 18-Jan-2007 08:33:46.  
mikeg22 wrote:
Whats the best way to get remoting to use this? Just run
Code:
SerializationHelper.Optimization = SerializationOptimization.Fast

on both client and server?


Yes, thats the plan.


  Top
bclubb
User



Location:
Norman, Oklahoma
Joined on:
12-Feb-2004 22:18:04
Posted:
934 posts
# Posted on: 16-Mar-2007 05:31:46.  
I moved your posts here Zanez. http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=9341&StartAtMessage=0&#51971
  Top
sangla
User



Location:

Joined on:
26-Mar-2008 08:46:21
Posted:
2 posts
# Posted on: 27-Mar-2008 03:52:47.  
simmotech wrote:

I have just added a minimally tested option for byte compression. By setting SerializationHelper.Compressor = new XXX() where XXX supports IByteCompressor or IMemoryStreamByteCompressor, the fast serializer/deserializer will compress/decompress the serialized data at the appropriate time.
By using an interface to support compression, you can plug in any compression utility external to the LLBLGen runtime library.
It should be easy to incorporate .NET 2.0s compression tools but I just haven't got round to it yet so I have included MiniLZO.cs as a sample but be aware that the majority of this code is not mine and is bound by the GNU General public Licence v2. Also it is 'unsafe' code for speed.

Cheers
Simon


I just used SerializationHelper.Optimization = SerializationOptimization.Fast to increase performance. But I don't know how to use Compressor property. Have you got some samples as your code that your posted?

Thanks!


Sang  Top
simmotech
User



Location:

Joined on:
01-Feb-2006 15:43:00
Posted:
1006 posts
# Posted on: 27-Mar-2008 10:41:10.  
sangla wrote:
simmotech wrote:

I have just added a minimally tested option for byte compression. By setting SerializationHelper.Compressor = new XXX() where XXX supports IByteCompressor or IMemoryStreamByteCompressor, the fast serializer/deserializer will compress/decompress the serialized data at the appropriate time.
By using an interface to support compression, you can plug in any compression utility external to the LLBLGen runtime library.
It should be easy to incorporate .NET 2.0s compression tools but I just haven't got round to it yet so I have included MiniLZO.cs as a sample but be aware that the majority of this code is not mine and is bound by the GNU General public Licence v2. Also it is 'unsafe' code for speed.

Cheers
Simon


I just used SerializationHelper.Optimization = SerializationOptimization.Fast to increase performance. But I don't know how to use Compressor property. Have you got some samples as your code that your posted?

Thanks!

Hi

The GNU General Public License for MiniLZO means that MiniLZO could not be included with LLBLGenPro.

However, if you and your app are comfortable with that license then you can include the MiniLZO source code into your app and then write a simple class that implements IMemoryStreamByteCompressor - all it would have to do for each interface method is pass it through to the corresponding MiniLZO static method. Then simply assign a new instance of your class to Serialization.Compressor on both client and server sides and thats it!

Cheers
Simon
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37866 posts
# Posted on: 27-Mar-2008 11:17:29.  
Do realize that if you use GPL v3 code in your app, linking IS covered by that license and therefore you've to distribute the sourcecode with your app if you distribute your application, including the runtime library sourcecode. This is possible in v2.5 but won't be possible in v2.6, as we've changed the license a bit (restricted BSD2)

As you just need to compress a byte array, you could look into more friendlier licensed compressor libraries.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
sangla
User



Location:

Joined on:
26-Mar-2008 08:46:21
Posted:
2 posts
# Posted on: 28-Mar-2008 03:33:15.  
Thank Simon. It's very simple. Regular Smiley
Sang  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.