[Mono-bugs] [Bug 464135] New regexp compiler much slower (~80x) than the old one with certain regexps

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 7 11:29:43 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=464135

User vargaz at gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=464135#c1





--- Comment #1 from Zoltan Varga <vargaz at gmail.com>  2009-01-07 09:29:43 MST ---
This is caused by the following regex:
                        css = Regex.Replace(css,
@"(?<=color\s*:\s*.*)\#(?<hex>f00)\b", "red", RegexOptions.IgnoreCase);

I have no idea why this runs fast either on .net, or in the old interpreter.
It contains a 'positive lookbehind': (?<=color\s*:\s*.*) which ends with a .*,
so for each text position, it matches all substrings which ends at that
position,
ie. for ABCD, it tries:

A
B
AB
C
BC
ABC
D
CD
BCD
ABCD

the input file is 32k characters long.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list