[Mono-devel-list] String::Equals Performance

Ben Maurer bmaurer at ximian.com
Sun Jul 4 16:20:28 EDT 2004


On Sun, 2004-07-04 at 16:00, Andreas Nahr wrote:
> > Some notes:
> >       * Why the regression on `10, neq, first char'? Alot of that goes
> >         away with -O=all, but still something to look at.
> 
> This seems very strange, could you attach the benchmark. Maybe it's a bug in
> the bench ;)
Ooops. Forgot to attach.

> >       * Ditto with `0 char, eq'
> 
> The old code had a shortcut for this case which I removed because it should
> be a rather seldom case
> 
> There is another removed 'shortcut' (sort of) which is for strings with
> exactly one char. These are also slightly slower now.

Ok.

> >       * You should not run this benchmark against the 1.0 release. Right
> >         after 1.0, I added a optimization to the jit which makes
> >         get_OffsetToStringData an intrinsic. This makes the statement
> >         fixed (char* a = b) much faster -- and that is the only way to
> >         get the data from a string if you are not inside the string
> >         class.
> 
> I'm only working from within the string class. But if a new prebuilt version
> comes I'll use it ;)

Well, generally its better if you can test the two methods in the same
execution (as in my attached benchmark). It makes things easier to
reproduce. It also allows you to run on the msft runtime.

-- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: streq.cs
Type: text/x-csharp
Size: 3539 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040704/aa7d53e1/attachment.bin 


More information about the Mono-devel-list mailing list