[Mono-dev] Re: Regular expression performance

Thomas Harning Jr. harningt at gmail.com
Sun Sep 11 20:18:22 EDT 2005


Thomas Harning Jr. wrote:
...
> I ran these tests with the "compiled" regexes on Mono.
> Strange enough... I re-ran the regexes non-compiled w/ the same
> performance stats.  Does Mono not have compiling yet???
...
It looks like Mono can't compile Regexes yet.  However... I ran the
tests on Windows and the performance was basically the same, lol.
So... I wonder what Regular expressions' deal is with multiple
options to match against.
I made a custom little attempt at optimizing the string searching so
that it could search for multiple patterns at the same time (with
the IndexOfAny(char, ...) function).  It was a bit slower than
completely searching through the string for the patterns.  W/ the
indexofany, I got the first character of the things to search for so
as to see if any matches were possible as it went through.  And if
it found one, I ran a loop through the patterns to see if the whole
pattern matched.  This sounds like it would work good, since I'm
greatly limiting the # of times characters are matched against...
but in my implementation it doesnt.

Guess it might be best to search for each little character pattern,
then try to grab out the data after.
-- 
Thomas Harning Jr.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050911/3fa884bc/attachment.bin 


More information about the Mono-devel-list mailing list