[Mono-devel-list] Char.IsXXX() patch: from InternalCall to managed

Atsushi Eno atsushi at ximian.com
Wed Feb 18 07:43:33 EST 2004


> I found that existing Char.IsWhitespace() and Char.IsSeparator() are
> slower than MS.NET. I found that they are InternalCall, so I tried to
> implement them in Char.cs natively and the got 2x speed. So I think
> it would be better if we move these (and the same kind of) methods
> into managed world.

Ok, it could be still more efficient. Now I added another IsDigit()
implementation (it is "optimized" specifically for digits).
It enhanced the speed nearly 2.5x to 3x and now faster than MS.NET,
especially the char is in ASCII range.

BTW, we have other IsXXX() methods:

	- IsControl()
	- IsLetter()
	- IsLower()
	- IsNumber()
	- IsPunctuation()
	- IsSurrogate()
	- IsSystem()
	- IsUpper()

It can be easily done (with an easy program like attached one).
Any volunteers on them?

Atsushi Eno

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: chartest.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040218/cfb5b576/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: optimize-char.patch
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040218/cfb5b576/attachment-0001.pl 


More information about the Mono-devel-list mailing list