Ignore:
Timestamp:
Jun 29, 2010, 3:01:29 PM (15 years ago)
Author:
[email protected]
Message:

2010-06-29 Michael Saboff <[email protected]>

Reviewed by Darin Adler.

Bug 41238 - RegExp performance slow on Dromaeo benchmark

Other javascript engines appear to cache prior results of regular
expression operations.

Suggest adding some sort of caching mechanism to regular expression
processing.

Added a single entry cache of match() results to RegExp class.

Also added performance improvements to UString == operator.
First check the impls for equality. Then get the length of
each of the non-null impls. Next check the sizes for equality.
Then check the data for the case of different impls that point
to the same data (most likely due to substrings from the beginning of
another string). Lastly we check the underlying data for equality.

  • runtime/RegExp.cpp: (JSC::RegExp::RegExp): (JSC::RegExp::match):
  • runtime/RegExp.h:
  • runtime/UString.h: (JSC::operator==):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/RegExp.h

    r61927 r62148  
    6868        const char* m_constructionError;
    6969        unsigned m_numSubpatterns;
     70        UString m_lastMatchString;
     71        int m_lastMatchStart;
     72        Vector<int, 32> m_lastOVector;
    7073
    7174#if ENABLE(YARR_JIT)
Note: See TracChangeset for help on using the changeset viewer.