Remoting, FastSerialization and Compressor

Posts   
 
    
stefcl
User
Posts: 210
Joined: 23-Jun-2007
# Posted on: 08-Nov-2007 19:14:06   

Hello, The new FastSerialization feature in 2.5 works amazingly well as it but I have read in the documentation that you can use a custom Compressor implementation to compress the stream even more. Such a thing could be very handy in my case because I'm going to send entities over a not-that-fast WAN connection. I'm thinking about gzipping the stream, but I wonder if the results would be worth the effort. Could someone share his experience with a Compressor?

Thanks in advance

simmotech
User
Posts: 1024
Joined: 01-Feb-2006
# Posted on: 09-Nov-2007 06:22:31   

stefcl wrote:

Hello, The new FastSerialization feature in 2.5 works amazingly well as it but I have read in the documentation that you can use a custom Compressor implementation to compress the stream even more. Such a thing could be very handy in my case because I'm going to send entities over a not-that-fast WAN connection. I'm thinking about gzipping the stream, but I wonder if the results would be worth the effort. Could someone share his experience with a Compressor?

Thanks in advance

If your project allows a GNU public licence and you are OK with 'unsafe' code (not really unsafe), then I recommend MiniLZO which you can download from http://www.codeproject.com/dotnet/FastSerializer.asp.

It has an additional method which accepts a MemoryStream from a SerializationWriter and if there is enough free space, will do the the compression 'inplace' within the MemoryStream's buffer. It is very quick and you might expect around a 50% reduction of the fast serialized bytes.

Cheers Simon

stefcl
User
Posts: 210
Joined: 23-Jun-2007
# Posted on: 09-Nov-2007 09:52:10   

Thanks for your answer,

It is very quick and you might expect around a 50% reduction of the fast serialized bytes.

I think that should not be too hard to get it to work with llblgen pro. Unfortunately, it's impossible to use any GPL libraries. I would be forced to release my source code and If I do that, my company would die instantly.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 09-Nov-2007 12:55:55   

You could use #ziplib. It has a GPL license with an exception (similar to GNU classpath, which is a restriction also found similarly in the Linux GPL license, which simply means that closed source apps can also link to it)

There are other alternatives, like commercial ones. There are also alternative packing libraries. After all, all you need is a C wrapper in C++/CLI to get a byte buffer packed/unpacked and you're good to go simple_smile

Frans Bouma | Lead developer LLBLGen Pro
stefcl
User
Posts: 210
Joined: 23-Jun-2007
# Posted on: 09-Nov-2007 21:49:13   

I'm going to try... Thanks