Bug 204481

Summary: Optimize String.prototype.replace() and replaceAll() for string searches.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: ASSIGNED    
Severity: Normal CC: ross.kirsling
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 204479    
Bug Blocks:    

Mark Lam
Reported 2019-11-21 16:40:25 PST
...
Attachments
Mark Lam
Comment 1 2019-11-21 17:55:13 PST
I created 3 microbenchmarks based on string-replace.js, string-replace-generic.js, and string-replace-empty.js, but use "f" as the searchValue instead of /f/g. With these, I see that the patch in https://bugs.webkit.org/show_bug.cgi?id=202471 did indeed regressed performance: Old New string-replace-generic-2 30.0312+-1.2393 ! 34.9829+-1.4384 ! definitely 1.1649x slower string-replace-2 29.4600+-1.1706 ! 33.9296+-2.0799 ! definitely 1.1517x slower string-replace-empty-2 20.7875+-0.4358 ! 24.9824+-1.1148 ! definitely 1.2018x slower
Note You need to log in before you can comment on or make changes to this bug.