Patrick Dubroy
@dubroy
My little side project for the past few weeks: a little JS parsing framework, with two different implementations:

1️⃣ A tree-walking interpreter
2️⃣ A switch-style bytecode interpreter

Finally got both to a working state, and the initial benchmark results are a little surprising!
Nov 2, 2023 · 20 · 1

I expected the bytecode interpreter to be faster, but it's actually significantly slower!

Next: figure out why :-)
Tweet image

Any V8 experts have an idea why there is a deopt at the beginning of the interpreter loop?

The exit condition is not complex — it's `do { ... } while (ruleStack.length > 0)`.

(Screenshot here from github.com/microsoft/deop…, which is a super useful tool)
Tweet image
Nov 4, 2023 · 2 · 1

I managed to fix a bunch of the deopt causes but the main method in my switch-based interpreter is still suffering from deopts for non-obvious reasons…

Seeing similar performance on JSC (w/ @bunjavascript). What's the best tool to investigate JIT performance in JSC?
Tweet image

https://twitter.com/dubroy/status/1720121014674133033 ∙ Archived on 2025-03-28.

← Twitter Archive: 2023