Skip to content

MKI

Bun 1.4 ships its Rust rewrite, and the production numbers hold up

Bun 1.4 replaces the Zig runtime with a Rust one, bumps its Node.js compat target to 26.3.0, and ships a long breaking-changes list worth reading before you upgrade.

Bun 1.4 shipped on August 20, 2026, and the headline is not a new API. It is that Bun’s entire runtime is no longer written in Zig. The rewrite to Rust, which landed as a single pull request adding just over a million lines across 2,188 files back in May, is now the code running in production under version 1.4. That is a bigger bet than most point releases carry, and unusually for a rewrite this size, the team shipped it with real numbers attached rather than just a promise that “it should be faster.”

We build and maintain JavaScript-heavy sites for a living, and a runtime rewrite of this scope is the kind of thing worth reading closely before it shows up in someone’s production Dockerfile. Bun 1.4 also bumps its Node.js compatibility target from 24.3.0 to 26.3.0, defaults to a new lockfile format, and ships a breaking-changes list long enough that the Bun team maintains it as its own tracking issue. None of that is reason to panic, but it is reason to read before you type bun upgrade.

This piece covers what actually changed, what the early production data says, where the breaking changes are most likely to bite, and what we would check before moving a service onto 1.4.

What changed

The Rust rewrite is the structural change everything else sits on top of. According to the pull request that landed it, the rewrite touched 2,188 files, and Bun 1.4 is the first stable release built on that code rather than the previous Zig implementation. Alongside it, three changes are worth flagging on their own:

Node.js compatibility target moved from 24.3.0 to 26.3.0. process.versions.node now reports 26.3.0, NODE_MODULE_VERSION is 147, and any native addon built against the old target needs to be rebuilt before it will load.

bun.lock now defaults to lockfileVersion: 2. Older Bun versions cannot read a v2 lockfile at all, existing v0/v1 lockfiles keep loading, and v2 additionally requires integrity hashes for off-registry npm tarballs and rejects unsafe git .bun-tag values at parse time.

bun:ffi moved off TinyCC-compiled bindings onto the engine’s native FFI path. returns: "cstring" now yields a plain string (null for a null pointer), and the old CString wrapper with .ptr / .byteLength / .arrayBuffer() is gone in favor of a plain string type. cc() still compiles with TinyCC, so inline C snippets are unaffected, but anything calling into dlopen()-loaded native code through the old CString shape needs an update.

These three sit at the top of the Bun team’s own tracking issue for the release, which is also where the rest of this article’s breaking-changes detail comes from.

The performance case, and who has already tested it

A rewrite this size only matters if it delivers, and Bun’s own release notes report roughly five times lower idle CPU, up to 48% less memory for HTTP server workloads, and about 50% faster startup on Linux, attributing the gains to consolidating JavaScriptCore and Bun onto the same mimalloc allocator, cutting unnecessary garbage-collection timer work, and reducing futex calls.

Two independent parties have already put numbers behind that claim. Anthropic’s Claude Code, which ships as a Bun executable, had been running on the Rust port in production for months before the public release; Bun’s own reporting on that internal rollout cites p99 CPU dropping from 24% to 10% and p50 CPU from 5.8% to 2.5%. Prisma separately launched its new Prisma Compute product on a Bun 1.4 canary, validating flat memory usage on a workload that had exposed a leak under the stable Bun release and confirming its SQL connection pool recovered correctly after scale-to-zero.

The most detailed third-party numbers we found come from Scrydon, a platform vendor that rolled 1.4.0 out to nine Bun-backed services in staging a day after release and measured before and after on equal 42-minute windows at matched pod ages. Their aggregate result: average CPU fell 49.9% (18.7 to 9.4 mCPU) and average container working-set memory fell 60.4% (754.6 to 298.5 MiB), while traced server traffic across the same services rose 27.1%. A non-Bun control service on the same infrastructure stayed flat, which is the detail that makes the comparison worth trusting rather than dismissing as noise from an unrelated traffic dip. Median request latency on matched routes improved 24–33% in their data, despite the higher traffic.

Worth being precise about what this is and is not: Scrydon’s own writeup calls these early staging results, not a controlled isolation of the Rust rewrite as the sole cause in a distributed system. But two organizations running unrelated production workloads independently landed on the same shape of result — sharply lower CPU and memory, no regression in throughput — which is a stronger signal than either data point alone.

What actually breaks

The breaking-changes list is long because a runtime rewrite touches everything, but most of it clusters around three areas that are worth testing deliberately rather than discovering in production.

Network protocol strictness went up across the board. Bun’s WebSocket implementation now fails the connection on unmasked client frames per RFC 6455, rejects ping() / pong() payloads over 125 bytes with a RangeError, and server.upgrade() now validates the opening handshake and returns false unless Upgrade: websocket and a well-formed Sec-WebSocket-Key are present. Bun.serve also now rejects HTTP requests whose Transfer-Encoding names anything other than a single, final chunked — so gzip, chunked or chunked, chunked get refused, where they were previously accepted. If you have a client or proxy anywhere in your stack that’s a little loose with framing, this is where you’ll find out.

Node.js compatibility changes affect anything doing real network or filesystem work. A node:tls server with requestCert: true and no explicit rejectUnauthorized now enforces client certificate verification by default, which is a meaningful behavior change for mutual-TLS setups that were relying on the old permissive default. node:fs.rm() options are now validated the way Node validates them, fs.open() with an options object passed as flags throws instead of silently opening read-only, and Windows filesystem errors now carry libuv’s error codes instead of negated CRT values. fetch() also now rejects the returned promise instead of throwing synchronously when option conversion fails, and duplicate response and request headers are combined with ", " per the Fetch spec rather than the previous last-wins behavior.

Tooling defaults changed under new projects. New monorepos default to linker: "isolated" for bun install, bun init templates now pin TypeScript 7 instead of 6, and bun build --compile executables no longer auto-load tsconfig.json or package.json from the working directory unless you opt back in with --compile-autoload-tsconfig / --compile-autoload-package-json. None of these are dangerous, but they will produce different output than the same command produced on 1.3.

Reception to the release itself has been mixed in a way worth naming honestly. Community discussion following the release, summarized by daily.dev’s roundup of the Hacker News and Lobsters threads, raised concerns about the pace of the rewrite — missed self-imposed release dates, a large volume of AI-authored pull requests from an automated contributor account, and debate over whether moving from Zig to Rust actually closes the memory-safety gap that was the stated reason for the rewrite, given the codebase still carries a number of unsafe blocks. That debate is unresolved and probably will stay that way until more production history accumulates. It doesn’t change the measured CPU and memory numbers above, but it’s a reasonable thing to factor into how quickly you move.

What we’d do about it

If you run a service on Bun today, this is a runtime upgrade worth doing deliberately rather than skipping or rushing. Concretely, before touching production: audit for native addons and rebuild anything compiled against the old NODE_MODULE_VERSION; if you use bun:ffi with dlopen()-loaded libraries, check every call site that reads .ptr or .arrayBuffer() off a returned CString, since that shape is gone; and if you run mutual TLS anywhere, explicitly set rejectUnauthorized on node:tls servers instead of relying on the old implicit default. Run your test suite and a staging soak with the new bun.lock v2 format before committing it, since older Bun versions in CI or on teammates’ machines won’t be able to read it back.

For anything fronting real traffic — a Bun.serve app, a WebSocket gateway, an API behind chunked transfer encoding — put it through a protocol-conformance pass specifically, since the newly strict WebSocket and Transfer-Encoding handling is exactly the kind of thing that passes every functional test and then rejects a legitimate client in production. Once that’s clean, the CPU and memory numbers above make this one of the more clearly worthwhile runtime upgrades we’ve seen this year, and we’d stage it the way Scrydon did: matched before/after windows, a non-Bun control where you have one, and enough of a soak period to trust the comparison before calling it done.

If you’re weighing a Node-to-Bun migration for a new service rather than upgrading an existing one, 1.4’s Node compatibility jump and the production evidence above are a reasonable point to reopen that conversation — talk to us if you want a second opinion on whether it fits your stack, or see how we approach web development generally.

Sources