HeadlinesBriefing favicon HeadlinesBriefing.com

pg_jitter: PostgreSQL's Faster JIT Compilation with sljit, AsmJit and MIR

Hacker News •
×

GitHub user vladich has released pg_jitter, a lightweight JIT compilation provider for PostgreSQL 14–18. It introduces three alternative JIT backends - sljit, AsmJit and MIR - replacing the notoriously slow LLVM-based JIT. This aims to make JIT compilation viable for a much wider range of queries, particularly in OLTP workloads where LLVM's overhead often exceeded query execution time.

The project addresses a core performance bottleneck identified in Postgres since JIT's 2018 introduction, where the interpreter handled expressions inefficiently. sljit stands out as the most consistent backend, offering 5–25% faster execution than the interpreter across all workloads thanks to its phenomenal compilation speed. MIR provides solid gains on wide-row/deform-heavy queries, while AsmJIT excels in specialized tuple deforming scenarios. Benchmarks show MIR and AsmJIT significantly outperform LLVM, with MIR delivering up to 30x improvements in some cases on wide tables. This development is crucial for developers seeking native code generation without the heavy LLVM dependency, offering a more practical JIT solution for modern PostgreSQL deployments.