Build1 distinct publisher3 min readUpdated
If emitting machine code for a query costs 5 microseconds instead of 50 milliseconds, the reason PostgreSQL only JITs long queries goes away. What is left is correctness and one CPU.
The Engineer · Build desk
Compiled by The EngineerSomething wrong?How this is made
The break-even test is the part that moves. PostgreSQL keeps JIT in the analytics box because, by its own documentation, compilation overhead can exceed the time saved on short work [3]. At the roughly 50 milliseconds the pgrust repository attributes to the LLVM or generated-code route [5], that box is drawn tightly: compiling for a statement that would otherwise finish in a millisecond costs fifty times the statement [2]. At 5 microseconds the same compile is half a percent of it [2]. The repository's 10,000-fold figure checks out as arithmetic [1], but the useful reading is not the ratio, it is that the threshold falls below the runtime of nearly every query an OLTP system serves [11].
Copy-and-patch is what buys it. pgrust skips intermediate representation entirely and emits ARM64 instructions, starting from small machine-code templates called stencils and patching in characters, addresses and branch offsets at runtime before joining them, copying them into executable memory and calling the result as an ordinary function [4]. That design moves correctness out of a compiler and into the stencil library. There is no optimizer between intent and bytes, which is why the compile is fast, and also why the review burden is per stencil and per instruction set. pgrust 0.2 aims its JIT at ARM's Neoverse V2, the core in AWS Graviton4, and the repository says pgrust runs elsewhere without comparable performance [9]. Malis's argument for that narrowing is that database workloads land on a small set of cloud hardware, so portability is the thing worth trading [10].
The evidence sits at an awkward distance from the claim. The published execution numbers come from a deliberately limited regular-expression engine that supports literal strings, concatenation and `*` repetition, with no alternation, no lookbehind and no parser [6]. On that engine, Malis's own benchmark had generated code running 12 to 20 times faster than the interpreter and roughly matching handwritten code, and those are demonstration results rather than an independent database test [7]. Three regex constructs is a long way from SQL, and the 5-microsecond figure measures compilation, not execution [5].
Then there is who wrote the instructions. Malis says he had never written assembly before this, his prior exposure being a security challenge, and that a coding agent produced much of the instruction-level work once he had specified the compiler's structure [8]. That is the actual wager: he and Seibel started the rewrite around April 2026 on the view that agents make it affordable to revisit architectural choices a mature database cannot change without breaking installations [13]. Emission is plainly cheaper now. Verification of hand-shaped machine code, multiplied by every stencil and every target you eventually want, is the cost the wager has not yet priced, and it is the cost that grows if pgrust ever needs a second instruction set.
The funding line is consistent with an unpriced bill. Malis said on Postgres FM that he has paid for pgrust personally out of proceeds from selling some Freshpaint equity, that the spending was becoming hard to sustain, and that this prompted work on reducing token use [12]. He is not new to the problem space; per his Y Combinator profile he joined Heap out of high school in 2015 and led work on a roughly petabyte PostgreSQL cluster [14]. The engineering claim and the financing claim are being tested in the same repository.
Ranked by verification strength, evidence, and original report placement.
Michael Malis and Jason Seibel built pgrust, whose JIT compiler generates query-specific machine code in roughly 5 microseconds, according to Malis.
The 5-microsecond compile time is fast enough for pgrust to compile every SQL query before executing it.
PostgreSQL already supports JIT compilation through LLVM, and its documentation says the feature is primarily useful for long-running, CPU-bound queries because compilation overhead can exceed the time saved on short work.
Instead of handing intermediate code to LLVM or generating C or C++, pgrust directly emits ARM64 machine instructions using a copy-and-patch design: small machine-code templates called stencils are filled in at runtime with values such as characters, addresses and branch offsets, then joined, copied into executable memory and called as a normal function.
The pgrust repository compares its roughly 5-microsecond compilation time with about 50 milliseconds for the LLVM or generated-code path, a claimed 10,000-fold reduction; the 5-microsecond figure measures compilation, not query execution.
Malis's tutorial applies the technique to a deliberately limited regex engine supporting literal strings, concatenation and repetition with the * operator, leaving out alternation, lookbehind and a parser.
Distinct publishers with included, body-backed reporting in this cluster.
1 article · August 23, 2026
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Mechanism documented, numbers self-reported
The compilation technique is described in reproducible detail (stencils, ARM64 emission, executable-memory setup, Rust emitter), and the article is careful to scope the 5-microsecond figure to compilation rather than execution. But every quantitative claim originates with Malis, the pgrust repository or a podcast appearance, the headline speedup demo is a deliberately crippled regex engine rather than a database workload, and nothing here is independently reproduced.
Pre-production experiment
Adoption evidence is confined to the project's own releases and test results: a 0.2 release whose JIT is tuned to one CPU, regression and isolation suite passes, and partial formal verification. The repository tells users not to store valuable data, extensions do not work, and no third-party deployment, pilot or user is named anywhere in the cluster.
Modestly overstated
The framing that a 10,000-fold compile-time cut 'drags JIT onto the short-query path' runs ahead of what is shown: the number measures compilation on one microarchitecture, the demonstration is a regex toy rather than SQL execution, and no end-to-end short-query latency improvement is reported. The gap is limited rather than large because the publisher itself scopes the metric, flags the demo benchmark, and foregrounds the correctness and portability caveats.
Founder-funded project seeking runway
The project's principal is self-funding it from an equity sale, has said the spend is hard to sustain, and is considering other funding approaches, which gives him a direct interest in the visibility of striking performance numbers. All figures in the cluster are self-published by that principal or his repository, and the single covering publisher relays them without independent measurement.
Single publisher, single origin
Confidence is limited by structure: one publisher, one article, and one upstream origin for all facts. The internal consistency is good and the caveats are unusually explicit, and the source body is truncated mid-sentence on the OLTP throughput claim, so parts of the performance picture are incomplete.
Follow any of these and your For You feed starts watching them — no settings page required.
build
A 7% ripgrep win is the wrong number in Dan Luu's agent experiment1 distinct publisher
build
In Postgres an UPDATE is an insert, and your page space pays for it1 distinct publisher
build
The Postgres MCP server in tens of thousands of installs stopped shipping in December 20241 distinct publisher
build
Perf work stopped being a specialist queue item, and slow endpoints became a choice1 distinct publisher