[Mono-devel-list] Patch for String.Equals

Andreas Nahr ClassDevelopment at A-SoftTech.com
Sun Apr 4 19:04:12 EDT 2004


I've been looking into optimizing the speed of some core classes.
The optimizations are mostly done using microbenchmarks, so somebody should test that for a bigger app like mcs (cant test because I devel on Windows without cygwin).
Here is the first one:
Using csc to compile and mcs to execute this speeds up String.Equals.
Speed for 1 char it is about equal to old. For 2-7 chars it is about twice as fast (it has special handling for up to 7 chars). For 9 gain is about 20% and then grows with size for long needed comparisons (75 chars it is about twice as fast as current solution).
For small compares it is even a lot faster than MS impl. (I also think compares to strings that only differ in the 100th char should be rather seldom).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040405/fb69bf14/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Patch.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040405/fb69bf14/attachment.txt 

More information about the Mono-devel-list mailing list