[Mono-dev] Serialization performance + remoting

pablosantosluac pablosantosluac at terra.es
Thu Aug 2 16:54:28 EDT 2007


Thanks Mirco,

Well, all my objects are already marked as [Serializable] instead of
extending the MarshalByRefObject.

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

The sample I'm using returns the 4700 objects in a single call (an array is 
returned)

Thanks!

pablo

On Thu, 2007-08-02 at 22:00 +0200, pablosantosluac wrote:
> Hi,
>
> I'd like to get some tips on how to speed up object serialization. In my
> current testing scenario I'm serializing about 7400 objects (references)
> (which in turn contain about 3 objects each), and in my laptop it takes
> about 1500ms to complete.

As smuxi [0] uses .NET remoting very heavily I had to test/tune a lot...
I found object references are very expensive, and not all objects need
to be passed by reference, like simple data containers (models). Just
add the Serializable attribute to those classes instead of extending
MarshalByRefObject.
Also synchronized calls are (time-)expensive, you should either try to
reduce the number of calls or use async calls.
I often use ngrep (network sniffer) to find unneeded calls, as the whole
communication is very transparent, you easily do calls without
knowing/noticing it....




More information about the Mono-devel-list mailing list