[Mono-devel-list] Patch for String.Equals
bmaurer at users.sourceforge.net
Sun Apr 4 19:48:52 EDT 2004
This is very interesting. Am going to look into the assembly we generate
to see if this is the best we can do.
I am a bit unsure about the long compares, what do they gain us?
Internally, they are just two int compares.
In the mean time, something to ponder --
The fastest way to do this might be to generate some hand done assembly.
This way, we can take advantage of what the processor gives us.
On Sun, 2004-04-04 at 19:04, Andreas Nahr wrote:
> 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).
More information about the Mono-devel-list