Bug 179230

Summary: Web Tooling Benchmark: fix RegExp pathologies
Product: WebKit Reporter: JF Bastien <jfbastien>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, fpizlo, jfbastien, keith_miller, mark.lam, mjs, msaboff, rmorisset, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 180537, 180538, 180874, 180876    
Bug Blocks:    

JF Bastien
Reported 2017-11-02 21:34:42 PDT
We seem pathologically slow on the coffeescript part of Web Tooling Benchmark: https://v8.github.io/web-tooling-benchmark/ Source: https://github.com/bmeurer/web-tooling-benchmark I get 0.22 runs / sec on STP 42, versus 8.24 runs / sec on Chrome 61.
Attachments
JF Bastien
Comment 1 2017-11-02 21:46:07 PDT
Non-fork source is actually: https://github.com/v8/web-tooling-benchmark
Saam Barati
Comment 2 2017-11-03 13:57:06 PDT
We're spending all our time interpreting these RegExps: ^\s*###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+ 8014.546220ms ^(?!\d)((?:(?!\s)[$\w\x7f-\uffff])+)([^\n\S]*:(?!:))? 8179.496043ms ^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*\])*)(\/)? 2951.752059ms ^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>*\/%])\2=?|\?(\.|::)|\.{2,3}) 2888.876650ms Michael believes we will get much faster if we JIT these patterns.
Radar WebKit Bug Importer
Comment 3 2017-11-03 14:40:26 PDT
Michael Saboff
Comment 4 2017-12-15 11:35:32 PST
Originally, the main RegExp issue was with the coffeescript test which spent most of its time in the aforementioned 4 regular expressions. Adding JIT support for greedy sub patterns (https://bugs.webkit.org/show_bug.cgi?id=180538) addressed some of these RegExp's. There is still the need to add JIT support for back references (https://bugs.webkit.org/show_bug.cgi?id=180874) to address the remaining Yarr interpreter use in coffeescript. Since this bug was created, the Web Tooling benchmark has changed. A few new tests have been added. Two of those new tests, acorn and espree, spend significant time in the Yarr interpreter evaluating non-greedy sub patterns. That work is tracked in https://bugs.webkit.org/show_bug.cgi?id=180876.
Michael Saboff
Comment 5 2018-09-05 11:25:24 PDT
We now have JIT support for greedy and non-greedy nested sub patterns, and back references including case ignore for 8 bit strings.
Note You need to log in before you can comment on or make changes to this bug.