[Mono-dev] Further improvements to toString performance

Antonello Moro antonello.moro at elsagdatamat.com
Thu Mar 20 09:03:18 EDT 2008


Will it be included in a future mono official release?


Eyal Alaluf wrote:
> 
> Hi, all.
> 
> The attached patch contains further improvements to the perf or ToString
> of primitive types.
> The perf gain is due to two changes
>   1. An instance of NumberFormatter is placed as a member of the Thread
> class. This allows reuse of the character array within the NumberFormat
> class and to cache the lookup of the NumberFormatInfo from the current
> culture which turns out to be a costly operation.
>   2. The default ToString of integers has been specialized (because of
> its simplicity).
> The results of these improvements are:
>   10,000,000 * 12345.ToString():    From 13.0 Secs to 6.3 Secs
>   10,000,000 * 12345.ToString("G"): From 14.7 Secs to 8.4 Secs
>   10,000,000 * 0.12345.ToString():  From 27.9 Secs to 21.3 Secs
> The results were made on my (a bit outdated) PC but the same
> improvements were seen in newer types of machines.
> I have also added the copyright and license notice.
> Your comments are welcome.
> 
> Thanks, Eyal.
> 
>  
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 

-- 
View this message in context: http://www.nabble.com/Further-improvements-to-toString-performance-tp16175350p16177875.html
Sent from the Mono - Dev mailing list archive at Nabble.com.



More information about the Mono-devel-list mailing list