yk adds a JIT to CPython and beats Python's own experimental JIT on 8 of 13 benchmarks
Adapting CPython for Yk
Laurence Tratt adapted CPython to work with yk, a meta-tracing JIT generator, in just a few days. The resulting ykcpython is faster than stock CPython on every benchmark except DeltaBlue and faster than CPython's experimental JIT on 8 of 13 AWFY benchmarks. The key insight: CPython's tier 2 interpreter, designed for its own JIT, is a better fit for yk than the tier 1 interpreter because it avoids trace churn from quickening. Only about 450 lines of code were added.
My view is that benchmark suite performance is a hoop to jump through rather than an end in itself: a system which benchmarks well might perform poorly in the real world; but a system which benchmarks poorly nearly always performs poorly in the real world.
- jonathaneunice
Very nice. I've loved PyPy as a way to run Python faster, but it only got to Python 3.12 this September, and that's still beta (https://pypy.org/posts/2026/10/pypy-v801-release.html). That's about 3 years after CPython's 3.12. JIT in CPython itself seems on-again, off-again, so great news that an external approach might be able to take up some slack.