[Webkit-unassigned] [Bug 45751] Extend YARR Interpreter with beginning character look-up optimization

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 30 17:46:37 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=45751





--- Comment #7 from Michael Saboff <msaboff at apple.com>  2010-09-30 17:46:36 PST ---
I did some analysis of this patch and why v8-regexp is slower with it.

Using shark, I examined the performance of the JIT code generated with and without the patch.  I looked at the top four regular expressions by time spent in the corresponding JIT'ed code. This patch doesn't change the JIT'ed code for the #1 regular expression, as it begins with (^|[^\\]).  Expressions 2, 3 and 4 are fixed strings of /NQ_VQ/, /d1/ and /d2/ respectively which are impacted by this code.

I think that this patch slows down these expressions since the code looks for the beginning characters in a loop, advancing index until the characters are found and then falls through to the original code which looks again at the first characters.  For each of these patterns, the patch isn't providing much benefit as they degenerate to looking for the beginning characters as well.  It may make sense to not emit the look for beginning characters when the whole pattern is a fixed string.

Although much more work, you may want to code up eliminating the normal character match for prefixes handled by the beginning check code.  This certainly would get complicated for captured characters.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list