Speculative Staging for Interpreter Optimization
Stefan Brunthaler

TL;DR
This paper introduces a novel speculative staging technique for interpreters that incrementally derives and substitutes optimized instructions at runtime, significantly boosting performance of dynamically typed language interpreters like CPython.
Contribution
It presents a portable, runtime technique for deriving and substituting optimized instructions, bridging the performance gap between interpreters and JIT compilers.
Findings
CPython interpreter speeds up by over four times
Technique sometimes outperforms PyPy's JIT compiler
Method is portable and leverages existing compiler backends
Abstract
Interpreters have a bad reputation for having lower performance than just-in-time compilers. We present a new way of building high performance interpreters that is particularly effective for executing dynamically typed programming languages. The key idea is to combine speculative staging of optimized interpreter instructions with a novel technique of incrementally and iteratively concerting them at run-time. This paper introduces the concepts behind deriving optimized instructions from existing interpreter instructions---incrementally peeling off layers of complexity. When compiling the interpreter, these optimized derivatives will be compiled along with the original interpreter instructions. Therefore, our technique is portable by construction since it leverages the existing compiler's backend. At run-time we use instruction substitution from the interpreter's original and expensive…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Logic, programming, and type systems · Formal Methods in Verification
