[Mono-dev] Serialization performance + remoting

Mirco Bauer meebey at meebey.net
Fri Aug 3 04:42:22 EDT 2007


On Thu, 2007-08-02 at 22:54 +0200, pablosantosluac wrote:
> Thanks Mirco,
> 
> Well, all my objects are already marked as [Serializable] instead of
> extending the MarshalByRefObject.

Ok, then you are passing the objects by value already.

> 
> So, you mean if I extend the class it will go worse?

Yes :)
As it will only transfer a proxy object which will always make remoting
calls for each method or property usage.
So code like this is very bad:
for (int i = 0; i < 10; i++) {
	Console.WriteLine(myRemoteObject.SomeProperty);
}
that will cause 10 remoting calls...

> 
> The sample I'm using returns the 4700 objects in a single call (an array is 
> returned)
Hmmm ok, so you have performance problems with the binary serialization
itself, not with the remoting/call overhead.

Then you might want to implement custom optimized binary serialization.
This can be done by implementing the serializable interface yourself. I
have not done this yet, but I will (for smuxi), as the built in binary
serialization of objects in MS .NET and Mono is pretty slow (actually
damn slow IMHO). The problem is that they are very generic
implementations to fit all cases, AFAIK.

How to implement faster binary serialization check this out:
http://www.codeproject.com/csharp/FastSerialization.asp

Maybe I will start a SmartBinarySerializer project :-P not sure...
As there is no free (as in MIT/X11, BSD, LGPL, whatever license)
implementation of an optimized binary serialization :(

-- 
Regards,

Mirco 'meebey' Bauer

PGP-Key:
http://keyserver.noreply.org/pks/lookup?op=get&search=0xEEF946C8

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d s-:+ a-- C++ UL++++$ P L++$>+++$ E- W+++$ N o? K- w++>! O---- M-
V? PS
PE+ Y- PGP++ t 5+ X++ R tv+ b+ DI? D+ G>++ e h! r->++ y?
------END GEEK CODE BLOCK------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070803/fe9b13d6/attachment.bin 


More information about the Mono-devel-list mailing list