Bug 179230
Summary: | Web Tooling Benchmark: fix RegExp pathologies | ||
---|---|---|---|
Product: | WebKit | Reporter: | JF Bastien <jfbastien> |
Component: | JavaScriptCore | Assignee: | 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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
JF Bastien
Non-fork source is actually: https://github.com/v8/web-tooling-benchmark
Saam Barati
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
<rdar://problem/35343582>
Michael Saboff
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
We now have JIT support for greedy and non-greedy nested sub patterns, and back references including case ignore for 8 bit strings.