[Mono-dev] ToString() performace in Mono

Miguel de Icaza miguel at novell.com
Thu Nov 22 15:05:54 EST 2007

> I've detected a performance hit on "plastic server" running on mono. I was 
> actually shocked because when I checked something similar working with 
> integers, Mono was actually faster than .NET. But it seems it is not the 
> case with strings.

This in particular is a test of performance of ToString as implemented
for Int32, whether that is the actual source of the problem or not is a
different matter.

What you are doing in this loop is creating a few thousand strings, I
get the feeling that the GC here is playing a larger role.   Since you
are killing the objects immediately, .NET might be able to just get rid
of them by doing a collection on the young generation.   Mono's GC is a
different GC.

Try keeping everything in an arraylist, that might help measure whether
the GC is having an impact.

More information about the Mono-devel-list mailing list