[Mono-devel-list] Patch for ToUpper/ToLower
Robert Shade
rshade at dvsconsulting.com
Sat Apr 24 16:05:50 EDT 2004
> I looked at their implementation and now I understand why my
Char.ToXXX
> functions are much faster ;)
> However I could not find any special cases that glib handles that we
do not
> (for the invariant case). If you find any, please write which!
> So it's all about speed...
Perhaps the extra stuff is for non-invariant locales.
> No - you do not have to use unmanaged code for that. However you still
need
> to Allocate a string, which unfortunatelly needs an internalcall.
> (Finding a way to not need the internalcall for constructing a string
with
> InternalAllocateString would really give the string class a speed
boost).
You're right. I didn't see that we had access to the 1st character like
that.
I've attached the necessary changes to Char.cs, icall.c, and locales.c.
They reflect your changes in String.cs. My only suggestion would be to
compare the culture.LCID to the Invariant ID 0x007F (as I did in
Char.cs) instead of CultureInfo.InvariantCulture.LCID. It might get you
a little more of that speed you're after. :)
rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcscharicalls.diff
Type: text/x-patch
Size: 3290 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040424/6f1c9dd3/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: monostringcharicalls.diff
Type: text/x-patch
Size: 5095 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040424/6f1c9dd3/attachment-0001.bin
More information about the Mono-devel-list
mailing list