Summary: | RegExp with anchor negation and grouping performance | ||
---|---|---|---|
Product: | WebKit | Reporter: | shahar.soel |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW --- | ||
Severity: | Normal | CC: | barraclough, ggaren, msaboff, org.webkit |
Priority: | P2 | ||
Version: | Safari 9 | ||
Hardware: | Mac | ||
OS: | OS X 10.10 |
Description
shahar.soel
2015-12-28 16:41:19 PST
fixed the jsperf example (was using wrong syntax for none capturing groups) http://jsperf.com/regexp-negation-in-group/6 JSPerf is down so I've added a reproducing jsfiddle instead. https://jsfiddle.net/cbepLyum/2/ (open the console to see the results). There is still a slowdown when using groups, but it is now by a constant factor of ~4, rather than dependent on the subject length. Surprisingly, the RegExp with two non-capturing groups is 10-20% faster than the one with only one. |