4 ms·
It looks like the current implementation [1] just always compiles to Bytecode which is then interpreted [2]. The usual one is more like PCRE JIT in that it defa
by boulos 6y ago
It looks like the current implementation [1] just always compiles to Bytecode which is then interpreted [2]. The usual one is more like PCRE JIT in that it defaults to using a macro assembler to generate machine code and execute it.
So I wouldn't draw too much from the current performance difference, it's primarily "simple interpreter vs machine code". IIUC, the plan from that blog post is to default to the backtracking mode (depth first) for a small-ish number of backtracks at which point you switch strategies to get that best of both worlds-ish behavior.
[1] https://github.com/v8/v8/blob/dc712da548c7fb433caed56af9a021d964952728/src/regexp/experimental/experimental-compiler.cc https://github.com/v8/v8/blob/dc712da548c7fb433caed56af9a021...
[2] https://github.com/v8/v8/blob/dc712da548c7fb433caed56af9a021d964952728/src/regexp/experimental/experimental-interpreter.cc https://github.com/v8/v8/blob/dc712da548c7fb433caed56af9a021...