JIT: so you want to be faster than an interpreter on modern CPUs…

21 points by sjamaan


nelhage

When running a short sequence of operations in a loop, the jumps will be far more predictable, making the branch predictor’s job easier, and thus improving the speed of the interpreter.

This used to be true, and has become accepted common knowledge, but it turns out branch predictors have improved, and can mostly handle interpreters just fine!

Jump-threading is still a win, but for different reasons (fewer instructions, and especially fewer branches), and the effect is smaller.

I recently wrote about the ITTAGE branch predictor, which is the main innovation behind this change.