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
- Beating the fastest lexer generator in Rustalic.dev
- Rewriting Bun in Rust | Bun Blogbun.com
- A Deep Introduction to JIT Compilers: JITs are not very Just-in-time | kipply's blogkipply.github.io
- A friendly introduction to machine learning compilers and optimizershuyenchip.com
- Many can write faster asm than the compiler, yet don't. Why? — LessWronglesswrong.com
- A Gentle Introduction to LLVM IR · mcyoungmcyoung.xyz
- Writing a C compiler in 500 lines of Pythonvgel.me
- ⭐️ Fast LLM Inference From Scratchandrewkchan.dev
- Rust Optimization.md · GitHubgist.github.com
- (Re)writing an interpreter in Rust – Danny van Kootendannyvankooten.com
- Just-in-time compilation - Wikipediaen.wikipedia.org
- Speculation in JavaScriptCore | WebKitwebkit.org