Automatically Retrofitting JIT Compilers - InfoQ
BT
InfoQ Software Architects' Newsletter
A monthly overview of things you need to know as an architect or aspiring architect.
View an example
Enter your e-mail address
Select your country
Select a country
I consent to InfoQ.com handling my data as explained in this Privacy Notice.
We protect your privacy.
Close
Helpful links
About InfoQ
InfoQ Editors
Write for InfoQ
About C4Media
Diversity
Choose your language
En
中文
日本
Fr
Aug26,2026
AI Security & Privacy Engineering Certification
Secure and govern production AI systems, from sensitive data to guardrails, evals, and audits.<br>Online. Register now.
Sep14,2026
Architect Certification
Distributed systems, decentralized decisions, platform engineering, and AI architecture.<br>Online. Register Now.
Aug21,2026
Engineering Leadership Certification
Work through leadership decisions with senior peers facing similar technical trade-offs.<br>Online. Register Now.
Nov16-20,2026
QCon San Francisco
What's working across AI, architecture, and leadership, from the teams doing it.<br>Register. Early bird ends August 11.
Dec15-16,2026
QCon AI New York
Production AI across agents, context, evals, security, and infrastructure, from the senior engineers building it.<br>Registration open.
Apr13-16,2027
QCon London
What early-adopter teams have proven in production, across 15 engineering tracks.<br>Register. Early bird ends August 11.
InfoQ Homepage
Presentations
Automatically Retrofitting JIT Compilers
Java
Automatically Retrofitting JIT Compilers
Like
Reading list
View Presentation
Vertical
Horizontal
Full
Speed:
1x
1.25x
1.5x
2x
42:43
Summary
Laurence Tratt discusses yk, an open-source meta-tracing JIT compiler framework. He shares how to automatically speed up C-based language interpreters like Lua and MicroPython with minimal, non-invasive code changes. He explains the inner workings of tracing loops, optimizing compiled traces using developer hints, and managing complex deoptimization back to the interpreter.
Bio
Laurence Tratt is the Shopify / Royal Academy of Engineering Research Chair in Language Engineering in the Department of Informatics at King’s College London. His research focuses on improving our ability to develop and use software, with a particular focus on performance: how can we make more software run at the speed that its users need and want?
About the conference
Software is changing the world. QCon London empowers software development by facilitating the spread of knowledge and innovation in the developer community. A practitioner-driven conference, QCon is designed for technical team leads, architects, engineering directors, and project managers who influence innovation in their teams.
Transcript
Laurence Tratt: Wouldn't it be great if we could make more of our programming languages run faster? Particularly the awkward squad, we might call them the dynamically typed language, or the scripting languages, the Luas, the Rubys, the Pythons, but also there are quite a lot of other language implementations out there that may not run as fast as you would like. CPU companies have CPU simulators and so on. What I'm going to do is show you that we can take existing language implementations and automatically add a just-in-time compiler to them. I'm going to introduce a new technology we developed called yk. The good news is that it does something fun. The problem is that showing performance is quite challenging. I'm going to start with a simple demo. Let's take the following Lua program, as has already been mentioned. Here is a Mandelbrot program, very standard. I've cranked the quality handle up a bit so that it runs reasonably long so we can actually benchmark something.
Lua is a dynamically typed language used in games, Neovim, various other places. Let's take the standard Lua VM that you would download from lua.org. We're going to run it and just see how long this takes. It's a Mandelbrot. It's taken 3.2 seconds. Very good. Now what I'm going to do is our fork of this same Lua VM run through the yk technology. It displayed a lot quicker. It's gone 0.8 seconds. That's about 4x faster. Now, you can bet your bottom dollar I have cherry-picked this example of something rotten. I've chosen something where we're particularly effective. Across a wider set of Lua benchmarks, probably a geomean of 2x is about right. The point is that we aren't just speeding up Lua here. We've just started a little bit of work. This is very early stage, not quite as advanced, looking at putting this into MicroPython, which is a small Python VM.
If we have a look at MicroPython on the well-known Fannkuch benchmark. It's doing something. We've put a little to do there. You can see it's roughly linear performance. This is the normal MicroPython implementation chugging away. How long does it take? Fifteen seconds. You guessed the same thing, we have our own fork, ykmicropython. Watch at some...