Changeset 34480 in webkit for trunk/JavaScriptCore


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.
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r34476 r34480  
     12008-06-10  Alexey Proskuryakov  <[email protected]>
     2
     3        Reviewed by Darin.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=16503
     6        match limit takes at least 13% of the time on the SunSpider regexp-dna test
     7
     8        Make the limit test slightly more efficient. It is not clear how much of a win it is,
     9        as the improvement on regexp-dna varies from 2.3% to 0.6% depending on what revision I
     10        apply the patch to. Today, the win on regexp-dna was minimal, but the total win was whopping
     11        0.5%, due to random code generation changes.
     12
     13        * pcre/pcre_exec.cpp: (match): Avoid loading a constant on each iteration.
     14
    1152008-06-09  Alp Toker  <[email protected]>
    216
  • 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.