String performance boost (Re: [Mono-dev] Patch to boost speedofUnicodeEncoding)

Atsushi Eno atsushi at
Fri Mar 17 07:58:19 EST 2006

Oh, forgot to mention, all my evaluations are done with Massi's
latest treeprop patch. That is, inline, copyprop, consprop and
deadce are enabled by default IIRC.

Atsushi Eno

Andreas Nahr wrote:
> Basically this also were my findings back then (you can even see some 
> functions where I did check if e.g. the length was > 10000 and then did 
> a fallback to native). (By the way: I believe in a huge number of 
> real-world cases strings will be rather short)
> Did you test using the current memcpy function? I think that it is 
> possible to do something notably faster than this method. If you are 
> using it just for copying chars I don't even think that these could 
> possibly be 1 or 3 byte aligned (Well at least I can't think of any 
> situation where they would be ;)
> But as I wrote the optimum would likely be to replace this method with 
> assembly on the most important platforms in the JIT.
> Another thing that I found back then is that running the managed 
> implementations on MS .Net usually gave another significant speedup, so 
> there is still potential for there as the mono runtime gets faster 
> (Maybe better Register Allocator?) while the unmanaged versions are not 
> likely to improve much.
> Also most of the implementations I wrote rely on inlining of the used 
> Char Methodcalls or they will be notably slower than native.

More information about the Mono-devel-list mailing list