Bug 15900 - 15% of string-validate-input.js is spent compiling the same regular expression
Summary: 15% of string-validate-input.js is spent compiling the same regular expression
Status: RESOLVED DUPLICATE of bug 15902
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 15861
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-08 13:02 PST by Eric Seidel (no email)
Modified: 2007-11-08 15:48 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2007-11-08 13:02:36 PST
15% of string-validate-input.js is spent compiling the same regular expression

I thought that ggaren fixed this with 15861, but it seems not.  Unless I'm somehow missing his change in my git-repo.

I tried moving "pattern" outside of the loop in string-validate-input.js and saw a 15% speed increase.  Looking at the shark sample, we're still spending all our time compiling the regexp.  Maybe the patch he landed as part of the old bug was just the "first step in the right direction".  Well, here is a bug to cover the other steps. :)
Comment 1 Eric Seidel (no email) 2007-11-08 13:04:24 PST
Of course, even moving pattern outside of the loop for our test run, we're still 38% slower:
    validate-input:    31.8% *slower*   106.4ms +/- 0.6%    140.2ms +/- 1.7%     significant
than spidermonkey is for this test. :(
Comment 2 Geoffrey Garen 2007-11-08 15:48:41 PST

*** This bug has been marked as a duplicate of 15902 ***