Closed
Bug 820118
Opened 12 years ago
Closed 12 years ago
Remove use of RegExpStatics from jsstr.cpp
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: sstangl, Assigned: sstangl)
References
(Blocks 1 open bug)
Details
Attachments
(2 obsolete files)
Regexp-related functions in jsstr.cpp currently use the RegExpStatics to pass around match data, which requires unnecessary malloc() and copying. Bug 808245 introduces ScopedMatchPairs output from re.execute(), which can be used in place of globals.
Minor perf impact, but significant improvements to code readability. Useful as a stepping stone to improving str_replace() performance for v8-regexp.
Note that I have already written this patch; once Bug 808245 lands, it just needs rebasing.
Assignee | ||
Comment 1•12 years ago
|
||
Work-in-progress patch. Numbers posted for a reduced v8-regexp benchmark that only includes calls to .replace().
The corresponding code from JSC is Source/JavaScriptCore/runtime/StringPrototype.cpp's removeUsingRegExpSearch().
The patch works completely, but only raises perf from ~2400 -> ~2650. Without any string concatenation whatsovever, perf is ~4600. v8's implementation manages ~6300.
From a profile, the hot functions are:
> 32.7% in JM/Ion/Yarr code -- likely mostly Yarr
> 13.3% in AppendSubstrings()
> 8.0% in Yarr's interpreter
> 5.0% in str_replace()
> 3.5% in str_replace_regexp_remove()
At this point, the only difference we have between our implementation of Yarr and Apple's is that Apple's JS engine optimizes for ASCII strings, and compiles special Yarr JIT code to handle ASCII strings more efficiently. The v8-regexp benchmark uses ASCII strings exclusively. The v8 engine makes the same optimization.
Assignee | ||
Comment 2•12 years ago
|
||
Assignee | ||
Comment 3•12 years ago
|
||
Comment on attachment 694627 [details] [diff] [review]
[WIP] Implement fast removal for str_replace().
Whoops, intended for Bug 820124.
Attachment #694627 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #694629 -
Attachment is obsolete: true
Assignee | ||
Comment 4•12 years ago
|
||
Since DoMatch() has been entirely circumvented for v8-regexp, this change is unnecessary for benchmark performance.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•