# Bun 1.4 After the Rust Rewrite: Real Benchmarks, Regressions, and the AI Verdict

Explore Bun 1.4's Rust rewrite, real benchmarks, Prisma deployment results, regression reports, and what Claude Code changed for developers.

Canonical URL: https://aiidelist.com/blog/bun-1-4-rust-rewrite-benchmarks-ai-review

Language: en

Published: 2026-10-29

Updated: 2026-10-29

## Key Takeaways

- **Performance gains are measurable but workload-specific.** Published developer tests show faster startup and lower memory consumption; HTTP throughput results require more caution.
- **Production evidence is encouraging.** Prisma reported that the Rust canary resolved the memory and connection-pool failures blocking its Compute deployment.
- **Compatibility still needs application-level testing.** Release notes confirm regressions, while issue reports document additional version-specific problems.
- **AI accelerated delivery; long-term maintenance quality remains an open question.** PR volume and automated review activity cannot establish reliability by themselves. 

**Updated October 29, 2026.** This analysis covers Bun 1.4 through 1.4.4. Benchmark numbers are attributed to their original authors; recommendations below are an engineering assessment of that evidence.

## What Changed in Bun 1.4?

Bun combines a JavaScript and TypeScript runtime with package management, bundling, and testing. The [Bun 1.4 announcement](https://bun.com/blog/bun-v1.4), published August 20, 2026, introduced the first stable Rust release and reported 1,517 additional passing Node.js tests. Its broader change list covers work since 1.3.0, so those improvements should not all be attributed to the language migration. 

The [Bun 1.4.4 release](https://bun.com/blog/bun-v1.4.4), dated October 22, adds further fixes and features, including formatting and type-checking improvements. It also includes security fixes affecting networking, database clients, and package management. Consequently, comparing 1.3.14 with 1.4.0 does not measure every change available in 1.4.4. 

**Bun still executes JavaScript through JavaScriptCore.** Rewriting the surrounding runtime in Rust does not replace JavaScriptCore or turn application JavaScript into Rust. This distinction matters when interpreting benchmarks. 

## How Claude Code Helped Rewrite Bun

In [Jarred Sumner's migration retrospective](https://bun.com/blog/bun-in-rust), the team reports an 11-day period from May 3 to May 14, with up to 64 Claude instances operating concurrently. The pre-merge token usage was valued at approximately $165,000 at API prices.

That figure is an API-price estimate, not a complete project budget. The 11-day milestone concerned migration and existing tests passing across platforms; stable release followed months later.

The account describes human-directed workflows, adversarial AI review, and manual verification that tests actually ran. It also discloses that Bun had joined Anthropic and that a prerelease Claude model was used. This makes the retrospective valuable engineering evidence, but not an independent evaluation of Claude Code. 

The transferable lesson is to evaluate AI-assisted migration through separate gates: compilation, behavioral equivalence, integration correctness, and operational reliability. Success at one gate does not establish success at the next.

## Bun 1.3.14 vs. 1.4.2: Published Benchmark Results

[Antony's StreamDrop benchmark](https://blog.leons.dev/bun-1-4-rust-benchmark/) compared official Linux ARM64 Docker images on an Apple M1 Max, with one CPU and 512 MiB available. Results used repeated-run medians and transfer byte-count checks.

| Measurement | Bun 1.3.14 | Bun 1.4.2 | Observed change |
|---|---:|---:|---:|
| Empty-script startup | 9.264 ms | 2.326 ms | 74.9% less time |
| HTTP text responses | 143,869 req/s | 155,497 req/s | 8.1% higher throughput |
| HTTP JSON responses | 121,292 req/s | 142,272 req/s | 17.3% higher throughput |
| 128 MiB relay throughput | 621 MiB/s | 943 MiB/s | 51.9% higher throughput |
| Relay peak memory | 117.8 MiB | 68.2 MiB | 42.1% lower |

These are complete-release comparisons, not controlled Rust-versus-Zig experiments. They describe this environment and workload; they are not universal performance guarantees. 

**Interpret the benefit in application terms.** Lower startup latency matters most when processes are created frequently. A persistent API server may benefit more from bounded memory, CPU efficiency, and tail latency than from saving milliseconds once at launch.

## A Second Benchmark Shows Why Methodology Matters

[Efrain Garay's independent comparison](https://efraingaray.com/en/blog/bun-zig-a-rust/) measured Bun 1.3.14 against 1.4.0 and found:

- Startup fell from **7.58 ms to 2.93 ms**.
- The downloaded binary was **12.9% smaller**.
- Memory after serving traffic fell from **44.5 MB to 27.5 MB**.
- Cold dependency installation changed from **2.43 seconds to 2.34 seconds**, a small difference in that test.

However, the author withdrew the original HTTP throughput comparison after discovering that the server and load generator shared physical CPU resources through SMT siblings. Those withdrawn numbers cannot support either an improvement or a tie.

The startup measurement also used a tiny program with the binary already in the page cache. It does not measure the full initialization cost of a large application. 

For useful comparisons, record CPU topology, architecture, container limits, cache state, dependency versions, and load-generator placement. Alternate candidate runs to reduce the effect of changing machine conditions.

## Production Feedback: What Prisma Actually Validated

[Prisma's deployment report](https://www.prisma.io/blog/bun-rust-rewrite-prisma-compute) provides evidence beyond short benchmarks. Its Compute platform needed instances to recover after suspension and resume without leaking memory or leaving database connections unusable.

In a repeated S3-read reproduction, stable Bun 1.3.14 exceeded a 900 MiB RSS threshold. The Rust canary completed a longer 4,096-iteration run with sampled RSS peaking around **118 MiB**. Prisma also reported that its previously reproducible SQL-pool failure after scale-to-zero recovery disappeared.

These were specific failure modes, not certification of every database operation or pooling configuration. The original June report described a public-beta deployment; a September update says Compute reached general availability in August. 

The practical inference is that recovery behavior deserves a place beside throughput in runtime evaluations. A service that responds quickly until its first network interruption can still fail its operating requirements.

## Why Rust Can Improve Reliability—and Where It Cannot

Rust's [Drop trait](https://doc.rust-lang.org/book/ch15-03-drop.html) lets a type define cleanup when an owned value is dropped. Centralizing resource cleanup can reduce the number of call sites that must independently remember to release a buffer, handle, or other resource. 

That mechanism does not establish correct HTTP behavior, scheduling, or API compatibility. Those properties still need specification checks and tests.

Bun's July retrospective estimated that approximately **4% of its Rust code was inside `unsafe` blocks**, with native-library interaction accounting for many small blocks. It also documented **19 migration regressions already fixed at that point**, including a side effect lost inside a debug assertion. 

The [Rust documentation for `debug_assert!`](https://doc.rust-lang.org/std/macro.debug_assert.html) explains the hazard: these assertions are disabled in optimized builds by default unless explicitly enabled.

An illustrative mistake is putting required work inside the assertion:

```rust
// Required work disappears when debug assertions are disabled.
debug_assert!(register_route());

// Perform the work independently of the diagnostic check.
let registered = register_route();
debug_assert!(registered);
```

If registration failure must stop execution in production, handle that failure explicitly as well. Moving the call preserves the side effect; it does not make a debug-only check a production error-handling policy. 

**Migration tests should run release builds as well as debug builds.** A translation can compile successfully while changing when an expression executes.

## Real Regression Reports: Read the Conditions, Not Just the Headlines

The [1.4.2 release notes](https://bun.com/blog/bun-v1.4.2) confirm fixes for two regressions introduced in 1.4.1: a bundler variable-name collision affecting Elysia and an `AsyncLocalStorage` retention issue. The latter could return correct context values while retaining memory longer than intended. Functional assertions alone would therefore miss part of the failure. 

Public issue reports add more specific test cases:

| Report | Reported behavior | Essential qualification |
|---|---|---|
| [React tests: #39876](https://github.com/oven-sh/bun/issues/39876) | Seven tests timed out under Bun 1.4.0 while passing on 1.3.14 | Depended on suite order and a one-CPU constraint; a collaborator could not reproduce it without the original suite |
| [HTTP/2: #39796](https://github.com/oven-sh/bun/issues/39796) | Inbound processing stalled for roughly 28 seconds | Reported under `bun test`; identical application code under `bun run` passed |
| [Drizzle type checking: #46946](https://github.com/oven-sh/bun/issues/46946) | Bun 1.4.4 reported type errors accepted by 1.4.3 and `tsc` 7.0.2 | A `bun check` report involving specific Drizzle beta types; not evidence that queries fail at runtime |
| [Windows sockets: #46604](https://github.com/oven-sh/bun/issues/46604) | Immediate port reuse after socket destruction produced `EADDRINUSE` | Waiting for the `close` event succeeded in the reporter's reproduction |

The React and HTTP/2 reports are especially useful reminders that runner mode, resource constraints, and accumulated state can change the outcome. They should not be generalized into claims that all React tests or HTTP/2 clients fail. 

The Drizzle and Windows reports were open when checked on October 29. An issue's open status does not prove every later build remains affected. These are attributed reports, not independently reproduced findings, and their existence alone does not identify AI generation or Rust as the cause.

## The Upload Edge Case: Faster Transfers Can Still Fail

The StreamDrop author also reported that five 256 MiB transfers succeeded on 1.3.14 and five failed on 1.4.2. Explicitly configuring `maxRequestBodySize` resolved the failure. 

For applications using Elysia's Bun adapter, the [configuration documentation](https://elysiajs.com/patterns/configuration) exposes this through `serve.maxRequestBodySize` and documents the default as 128 MiB. A configuration excerpt for an application choosing a 300 MiB request limit is:

```ts
import { Elysia } from 'elysia';

const app = new Elysia({
  serve: {
    maxRequestBodySize: 300 * 1024 * 1024,
  },
});

// Add the application's routes and start the server separately.
```

The limit above is an example policy, not a recommended size for every service. It applies to the request body, which can include multipart overhead beyond the file itself. 

Test just below, at, and above the intended boundary. Also test interrupted uploads, unknown-length streams, multiple concurrent uploads, and reverse-proxy limits. Assert the received bytes or checksum; an HTTP success response alone does not establish file integrity.

## What AI Maintenance Statistics Actually Tell Developers

An [October analysis by aictrl.dev](https://aictrl.dev/blog/open-source-review-ai-era), based on GitHub activity, reported the following for Bun:

| Metric | Reported result |
|---|---:|
| Weekly merged PRs, earlier baseline to Q3 2026 | 56 → 180 |
| Q3 merged PRs opened by `robobun` | 79% |
| PRs without a counted non-author human comment | 80% |
| Average AI review comments per PR | 9.5 |

The methodology excludes certain commands and templated comments. It measures visible discussion, not whether someone read the diff. Automated-account authorship also does not measure the percentage of code written by AI.

These figures support increased merge throughput and extensive automated review activity. They do not establish defect density, reviewer effectiveness, or total engineering cost. The analysis itself is disclosed as AI-assisted. 

To evaluate maintenance quality, track outcomes instead:

- **Escaped regressions:** defects introduced by a release and discovered after deployment.
- **Repair durability:** whether fixes stay fixed across subsequent releases.
- **Time to validated resolution:** when the original reproduction passes, rather than when a PR merely merges.
- **Operational impact:** crashes, corrupted results, prolonged stalls, and forced rollbacks.
- **Review traceability:** a clear explanation of the failure, the correction, and the regression test.

The reviewed evidence does not provide a controlled long-term comparison of AI-heavy maintenance against a human-only Bun team.

## Should Developers Adopt Bun 1.4?

Adoption is easier to assess when package management, build tooling, test execution, and the production runtime are treated as separate decisions.

| Workload | Suggested adoption path | Evidence to require |
|---|---|---|
| Local scripts and command-line tools | Pilot selected tasks | Correct output, exit codes, subprocess behavior |
| React or Vue development | Evaluate dependency installation and development commands separately | Lockfile behavior, HMR, browser tests, production assets |
| Browser extension builds | Compare generated packages | Manifest validity, asset paths, content-script loading |
| HTTP APIs | Stage the exact release before rollout | Authentication, uploads, streaming, latency, disconnect handling |
| Database-heavy services | Exercise recovery before migration | Reconnection, transaction behavior, pool limits, bounded memory |
| Mature critical services | Keep the current deployment available during evaluation | Existing reliability targets and a verified rollback path |

These are evaluation priorities, not blanket compatibility ratings. A workload with strong integration coverage may justify adoption sooner than a simpler application with no reliable tests.

## A Practical Bun Upgrade and Benchmark Checklist

**1. Record the actual binaries.** The [installation documentation](https://bun.com/docs/installation) provides version and revision commands:

```bash
bun --version
bun --revision
node --version
```

Pin the candidate release in CI and deployment configuration. Keep the previously validated deployment artifact available. Use an exact container digest when reproducible container contents matter. 

**2. Verify which runtime executes the workload.** Bun normally respects a CLI's Node shebang. A command launched through Bun may consequently execute application tooling under Node. The [runtime documentation](https://bun.com/docs/runtime) describes the `--bun` override:

```bash
# Force the locally installed Vitest CLI to execute under Bun.
bun --bun run vitest run
```

Inspect project configuration too: [`run.bun` in `bunfig.toml`](https://bun.com/docs/runtime/bunfig) can change executable resolution. Record the runtime from inside the tested process when results are ambiguous. 

**3. Change one layer at a time.** Keep the dependency graph, compiler configuration, application commit, environment variables, and workload fixed when testing a runtime upgrade. Evaluate package-manager changes separately, then test the final combined configuration.

**4. Test deployed artifacts.** Run browser and API checks against the actual production build. Include CSS output, code splitting, dynamic imports, source maps, environment handling, and graceful shutdown where relevant.

**5. Exercise lifecycle boundaries.** Disconnect databases, interrupt clients, exhaust connection pools, resume idle instances, and run under realistic CPU and memory limits. Verify that failures terminate or recover within defined deadlines.

**6. Measure sustained behavior.** Record p95 and p99 latency, errors, CPU, RSS trends, open connections, and restart counts. Report absolute values as well as percentages. Keep the load generator off the server's constrained CPU allocation.

**7. Define rollout gates in advance.** Set acceptable limits using the application's existing service targets. Expand deployment only after the candidate passes those limits; revert when it does not.

## Frequently Asked Questions

**Does Bun's Rust rewrite prove Rust is faster than Zig?**

No. The published comparisons change entire runtime releases, including other implementation and engine changes. They establish results for those binaries under those test conditions.

**Does more automated code review mean better code?**

Comment counts cannot answer that. Review value depends on defects caught, correctness of proposed fixes, and behavior after release.

**Can Bun be used without replacing every Node.js workflow?**

Yes. Evaluate its roles individually and verify the executable used by each command. Successful dependency installation is separate evidence from successful production runtime execution.

**Is Bun 1.4 production-ready?**

There is credible deployment evidence, alongside documented regressions and unresolved reports. The decision should depend on the exact patch release and whether it passes the application's correctness, recovery, and reliability requirements.

## Conclusion

Bun 1.4's Rust rewrite has credible technical value: published tests and deployment reports show improvements worth evaluating. The AI-assisted development process also demonstrates substantial delivery capacity.

The remaining question is how consistently those gains survive real workloads and subsequent releases. **Choose one representative application, pin a candidate version, and test correctness, recovery, and sustained resource use before widening deployment.** Those results provide a stronger basis for adoption than the implementation language, generated line count, or headline benchmark alone.
