JIT Compiling Code in 5μs

Historically, fast JIT compilation was a black art requiring deep assembly knowledge. Now, with AI assistance, it's easier than ever. The author built pgrust, a database with a JIT compiler that compiles SQL queries in about 5μs, enabling JIT compilation for every query. This post walks through building a simple regex engine with a JIT compiler using copy-and-patch stencils, targeting ARM64 assembly, and achieving performance comparable to handwritten code.
To write a fast JIT compiler, you would need to know how to write assembly.