[Mono-devel-list] [Patch] First patch for making String managed
05mauben at hawken.edu
Tue Jun 1 12:26:00 EDT 2004
This is why we have -O=inline.
The numbers for speed improvement seem false. An extra call should not be 80% of the overhead.
If inlining is needed, it should be done with -O=inline. If the method is not inlined by enabling the opt, and there is a large perf gain, the rules for -O=inline need to be investigated.
WRT benchmarks, try adding command line options. When you give stats, people simply have to be able to reproduce them.
Btw, please split up your patches. We should have one patch per method. It makes reviewing easier.
>>> "Andreas Nahr" <ClassDevelopment at A-SoftTech.com> 06/01/04 11:48 AM >>>
The code duplication is intentionally at this point. If you look at it you
can see that creating one implementation and then calling these would only
save a few LOC for the 12 methods implemented. However as they don't get
inlined the speed loss would be substantial (e.g. IndexOf 782ms -> 1262ms).
As corlib should get ngen'ed at some point anyway I personally think that
about 50 bytes additional IL (for all 12 methods) for 80% speed improvement
is a pretty good investment. String is probably the most used class out
there, so it should be well worth it.
P.S. I don't have any 'just runnable' benchmark available for that as I
just have a file that I tailor for my needs. I'll attach it, but I think its
pretty useless for someone else, as it requires constant modification.
----- Original Message -----
From: "Ben Maurer" <05mauben at hawken.edu>
To: <ClassDevelopment at A-SoftTech.com>; <mono-devel-list at lists.ximian.com>
Sent: Tuesday, June 01, 2004 4:30 PM
Subject: Re: [Mono-devel-list] [Patch] First patch for making Stringmanaged
There is way too much code duplication here. Please have *one*
implementation for each method and have the overloads call there.
>>> "Andreas Nahr" <ClassDevelopment at A-SoftTech.com> 06/01/04 10:06 AM >>>
This is a patch that gets all IndexOf - kind methods dealing with chars into
the managed realm.
Please test and provide feedback.
Here are some microbenchmark results (especially cool are the results for
IndexOfAny and LastIndexOfAny):
IndexOf (17): 1132 -> 791
IndexOf (2162): 10576 -> 7862
LastIndexOf (similar to above)
IndexOfAny (long string, nothing found): 25867 -> 2984
LastIndexOfAny (similar to above)
More information about the Mono-devel-list