6 ms·
Wait, the second fastest is the Javascript one?
by towelguy 11y ago
Wait, the second fastest is the Javascript one?
- eddyb 11y agoI'm not surprised, v8 has a RegExp JIT (irregexp IIRC) which used to be 20x faster than SpiderMonkey's RegExp for simple patterns. Back when I was playing with parsers in JS, the fastest approach to anything string-related was through RegExp, even trivial tasks like "first character is X". The caveat, of course, was that you would only get that performance under v8. Nowadays it should be more balanced, but I have no idea how v8 compares to SM anymore.