Ignore:
Timestamp:
Jun 10, 2008, 7:54:39 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin.

https://bugs.webkit.org/show_bug.cgi?id=16503
match limit takes at least 13% of the time on the SunSpider regexp-dna test

Make the limit test slightly more efficient. It is not clear how much of a win it is,
as the improvement on regexp-dna varies from 2.3% to 0.6% depending on what revision I
apply the patch to. Today, the win on regexp-dna was minimal, but the total win was whopping
0.5%, due to random code generation changes.

  • pcre/pcre_exec.cpp: (match): Avoid loading a constant on each iteration.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/pcre/pcre_exec.cpp

    r34386 r34480  
    411411    int min;
    412412    bool minimize = false; /* Initialization not really needed, but some compilers think so. */
    413     unsigned matchCount = 0;
     413    unsigned remainingMatchCount = matchLimit;
    414414   
    415415    MatchStack stack;
     
    444444   
    445445RECURSE:
    446     if (++matchCount > matchLimit)
     446    if (!--remainingMatchCount)
    447447        return matchError(JSRegExpErrorHitLimit, stack);
    448448
Note: See TracChangeset for help on using the changeset viewer.