[Mono-dev] Serialization performance + remoting

pablosantosluac pablosantosluac at terra.es
Thu Aug 2 16:00:10 EDT 2007


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.

Well, AFAIK if you get rid of Equals and GetHashCode methods on the objects 
to be serialized you can improve performance. I checked it and it actually 

My problem is that I have a code fragment on the server which takes 
(measured at the client) about 2seconds to finish. Well, about 500ms is 
actual processing, the rest is the framework doing serialization.

Running with the profiler I found out that most of the time is being spent 
in a class called System.Runtime.Serialization.ObjectIDGenerator. It is 
actually trying to locate which objects are already serialized. I run with 
mono and got almost the same results (ok , I didn't run with the profiler 
but got more or less the same results in terms of timing).

So, it seems the process gets more affected by the number of objects to be 
serialized than the size of data.

Because the people who actually implemented both serialization and remoting 
are in this list :-) I'd like to ask them to share with us some tips to 
improve performance in serialization/remoting: I don't know, maybe always 
reduce the number of objects involved (unwrap the structures into 
communication specific ones), get rid of some methods, avoid some data 
types... whatever...



More information about the Mono-devel-list mailing list