[Mono-dev] ToString() performace in Mono
pablosantosluac
pablosantosluac at terra.es
Thu Nov 22 04:44:13 EST 2007
I can try for this sample, but I'm afraid the ToString is being implicity
used in several locations
----- Original Message -----
From: "Petit Eric" <surfzoid at gmail.com>
To: "pablosantosluac" <pablosantosluac at terra.es>
Cc: <mono-devel-list at lists.ximian.com>
Sent: Thursday, November 22, 2007 10:24 AM
Subject: Re: [Mono-dev] ToString() performace in Mono
> Do you try to replace String by a System.Text.StringBuilder ?
>
> 2007/11/22, pablosantosluac <pablosantosluac at terra.es>:
>> Hi,
>>
>>
>> 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.
>>
>> Please consider the following code sample:
>>
>>
>> using System;
>>
>> namespace compareCompare
>> {
>> class Class1
>> {
>> static void Main(string[] args)
>> {
>> int ini = Environment.TickCount;
>>
>> string k = string.Empty;
>>
>> for( int i = 0; i < 6000000; ++i )
>> {
>> k = i.ToString();
>> }
>>
>> Console.WriteLine("val is {0} and time {1}", k,
>> Environment.TickCount - ini);
>> }
>> }
>> }
>>
>>
>> And the following results:
>>
>> >compareCompare.exe
>> val is 5999999 and time 3525
>>
>> >"c:\Archivos de programa\Mono-1.2.5.2\bin\mono.exe" compareCompare.exe
>> val is 5999999 and time 11577
>>
>>
>> Thanks,
>>
>>
>> pablo
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
More information about the Mono-devel-list
mailing list