Skip to content

BuildNot yet confirmed elsewhere1 publisher3 min readPublished

pgrust's 5-microsecond compile drags JIT onto the short-query path

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

How we use AISend a correction

What happened

  • Michael Malis and Jason Seibel say their PostgreSQL rewrite, pgrust, emits query-specific machine code in roughly 5 microseconds.
  • The repository puts that against about 50 milliseconds for the LLVM or generated-code path, and says the figure measures compilation, not execution.
  • Version 0.2 targets ARM's Neoverse V2, the core in AWS Graviton4, and the repository warns performance elsewhere will not match.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • capability Compiled execution stops being a tail optimisation for long analytics scans and becomes available to the whole population of short statements, which is most of what a transactional system runs.
  • exposure Putting hand-patched machine code in front of every statement changes the failure mode from a slow query to a wrong row, on the path where wrong rows are hardest to notice.
  • constraint Adopting pgrust for the compile speed also means adopting Graviton-class hardware as a performance floor; that is procurement, not a config flag you flip later.
  • cost The bill so far falls on one founder's equity proceeds, which makes the project's continuity a financing question that no benchmark answers.

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 [15]. At 5 microseconds the same compile is half a percent of it [15]. The repository's 10,000-fold figure checks out as arithmetic [14], 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 [16].

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 [12]. 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 [11]. 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 [13]. The engineering claim and the financing claim are being tested in the same repository.

What to watch

  • An independent benchmark on a real database workload, measuring compilation plus execution, rather than the regex demonstration.
  • Whether pgrust ships stencils for a second instruction set, and what that does to the maintenance and verification cost it currently avoids.
  • Whether pgrust picks up outside funding, given Malis's statement that his personal spending on it is hard to sustain.

Clarity's read

What the record supports and how the coverage leans. The claims behind it follow.

Reality

Evidence38
Adoption12
Hype gap+22
Incentives62
Confidence42
Why these scores

Claim ledger

Ranked by verification strength, evidence, and original report placement.

  1. [1]

    Michael Malis and Jason Seibel built pgrust, whose JIT compiler generates query-specific machine code in roughly 5 microseconds, according to Malis.

    ReportedSupportedSource: Michael Malis, via runtimewire.comView cited source
  2. [2]

    The 5-microsecond compile time is fast enough for pgrust to compile every SQL query before executing it.

    ReportedSupportedView cited source
  3. [3]

    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.

    ReportedSupportedView cited source

Sources

1 independent publisher whose own reporting we read for this story.

  1. runtimewire.com

    1 article · August 23, 2026

    pgrust says its JIT compiles code for every SQL query in 5 microseconds

Share your take

Let Clarity write the post for you.

Signed-in readers get a short post drafted on this story in the register they choose — narrative, analytical, or a direct position — editable to the last word before it goes anywhere. The share buttons at the top of this story work without an account.

Topics and entities

Follow any of these and your For You feed starts watching them — no settings page required.

Topics

Entities

Loading related stories