3 ms·
I honestly do not know how regex JITs are tuned, but in JS JITs, even tens of thousands of iterations may not suffice. Just to be sure, I would concatenate som
by azakai 13y ago
I honestly do not know how regex JITs are tuned, but in JS JITs, even tens of thousands of iterations may not suffice.
Just to be sure, I would concatenate some more stuff ;) so the test runs for say 10 seconds.
- eliben 13y agoWhile it seems strange to me that a highly repetitive computation that lasts ~0.2 seconds would not kick the JITs (who needs them, then ;-) ?), I tried a simple blow-up of the input (by abusing "cat") - same results. For a 16MB input with > 2.6 million tokens, the handwritten lexer smokes the single-alternating-regex one: 1.1 sec vs. 2.9 sec.
- azakai 13y agoNice, thanks for verifying that. Was a longshot, but might as well rule out everything possible.