JIT Compiling Code in 5μs - malisper.me
malisper.me · 3,089 words · saved by 1 readers
Build a copy-and-patch JIT compiler in Rust, generate ARM64 machine code, and benchmark it against an interpreter and handwritten implementation.
Historically, fast JIT compilation was a black art. To write a fast JIT compiler, you would need to know how to write assembly. Case in point: there is no production-ready database today that has its own JIT compiler. They all either use LLVM or generate C/C++ code. Both of these options suffer from high compile times, which limits their applicability. Now, with the use of AI, it’s easier than ever to write a JIT compiler with fast compile times by directly targeting assembly. This is also one area of opportunity for new databases to improve on old ones. When building pgrust, I initially…
saved by
related reading
- Rewriting Bun in Rust | Bun Blogbun.com
- NYSRGnotes.ekzhang.com
- Just-in-time compilation - Wikipediaen.wikipedia.org
- A Deep Introduction to JIT Compilers: JITs are not very Just-in-time | kipply's blogkipply.github.io
- Writing Toy Software Is A Joyblog.jsbarretto.com
- A crash course in just-in-time (JIT) compilers - Mozilla Hacks - the Web developer bloghacks.mozilla.org
- Speed mattersscattered-thoughts.net
- Reddit - Please wait for verificationreddit.com
- Many can write faster asm than the compiler, yet don't. Why? — LessWronglesswrong.com
- How Compiler Explorer Works in 2025 — Matt Godbolt’s blogxania.org
- Hōrōshi バガボンド (@KatanaLarp) on Xx.com
- (Re)writing an interpreter in Rust – Danny van Kootendannyvankooten.com