{"slug": "bun-1-4-ships-the-rust-rewrite-what-got-faster", "title": "Bun 1.4 Ships the Rust Rewrite: What Got Faster", "summary": "Bun 1.4 shipped on August 20, completing the runtime's migration from nearly one million lines of Zig to Rust, a rewrite the Bun team began in May 2026 and accelerated with AI agents. On Linux x64, Bun 1.4 handles 48,243 HTTP requests per second versus Node 26's 25,181, with startup falling to 5.1ms from 10.9ms in Bun 1.3, idle CPU down 5x, and memory down up to 35%, though the launch carried 19 admitted regressions and 20 day-one GitHub issues. The release adds Bun.WebView headless browser automation, Bun.Image, Bun.markdown, and Bun.cron(), plus an opt-in global virtual store for package installs; Vercel shipped same-day support but made the upgrade opt-in and directed teams to the official breaking changes list.", "body_md": "Bun 1.4 shipped August 20, and the Rust rewrite is done. After three months of migration, nearly one million lines of Zig code replaced with Rust, and a final stretch powered in part by AI agents, the runtime is faster, the standard library is bigger, and the breaking changes are real. Whether you upgrade today or wait depends on what you are running — here is what you need to know.\n\n## Why Rust, and Why Now\n\nThe Bun team moved from Zig to Rust in May 2026, citing memory safety guarantees that Zig’s manual memory management cannot match. Rust’s ownership model catches whole classes of memory bugs at compile time — and for a runtime that thousands of production services depend on, that matters.\n\nThere is an elephant in the room: this was the largest AI-assisted codebase migration ever attempted in public. The team used AI agents to accelerate the rewrite, and by their own admission, no human read the full diff. The 19 admitted regressions and 20 day-one GitHub issues at launch are a direct consequence. Vercel, which shipped Bun 1.4 support the same day, made the upgrade opt-in and told teams to consult the [official breaking changes list](https://github.com/oven-sh/bun/issues/28792) first. That is the right posture.\n\n## The Performance Numbers\n\nDespite the rough launch, the benchmark data is holding. On Linux x64, Bun 1.4 handles 48,243 HTTP requests per second against Node 26’s 25,181. Startup drops to 5.1ms from 10.9ms in Bun 1.3 — and 27.2ms in Node. Idle CPU is down 5x. Memory drops up to 35%.\n\nThe numbers survive contact with production. Scrydon, which runs nine Bun services, [reported a 49.9% average CPU reduction and 60.4% memory reduction](https://scrydon.com/insights/2026/08/21/bun-1-4-at-scrydon/) after upgrading. Real workloads, real hardware, real savings.\n\n## Browser Automation Without Playwright\n\nThe most practically useful addition is `Bun.WebView` — headless browser automation built into the runtime. On macOS, it drives the system WebKit with zero external dependencies. On Linux and Windows, it controls Chrome or Chromium via the Chrome DevTools Protocol. No browser download, no separate package.\n\n``` js\nconst view = new Bun.WebView({ headless: true });\nawait view.goto(\"https://example.com\");\nconst title = await view.evaluate(() => document.title);\nconst screenshot = await view.screenshot();\nawait view.close();\n```\n\nClicks register as OS-level events (`isTrusted: true`), and the API auto-waits for element actionability before acting — the same model Playwright uses. For scraping, screenshot services, and lightweight automation, this eliminates the Puppeteer install entirely. Read the [Bun.WebView documentation](https://bun.com/docs/runtime/webview) for the full API surface.\n\nThe honest caveat: `Bun.WebView` is not a Playwright replacement yet. No built-in test runner, no trace viewer, API is still experimental. For production test suites, keep Playwright. For everything else, try WebView first.\n\n## A Standard Library That Actually Replaces npm\n\nThree more built-in APIs ship alongside WebView, all designed to cut npm dependencies:\n\n- **Bun.Image** — native image processing without Sharp\n- **Bun.markdown** — renders GitHub Flavored Markdown to HTML, React JSX, or terminal ANSI output\n- **Bun.cron()** — in-process cron scheduling that shares memory and database pools with your main app\n\nThe cron API is worth calling out specifically. Instead of a separate process, jobs run inside your server:\n\n``` js\nBun.cron(\"0 9 * * *\", async () => {\n  await sendDailyReport();\n});\n```\n\nEvery package you stop installing is one fewer attack surface. Given the state of npm supply chain security, fewer dependencies is not just a convenience — it is a security argument.\n\n## 7x Faster Package Installs\n\nThe package manager gets an opt-in global virtual store. Instead of copying packages into `node_modules` on every install, Bun extracts them once to a global cache and symlinks project directories to it. On a warm CI run with 1,400 packages: 7x faster. Five project clones: 400MB instead of 2GB.\n\n```\n# bunfig.toml\ninstall.globalStore = true\n```\n\nThis requires the isolated linker, which is not the default for existing projects. New package commands also land in 1.4: `bun audit fix`, `bun dedupe`, `bun prune`, and `bun run --parallel`.\n\n## Should You Upgrade?\n\nThe Node.js compatibility target jumped to 26.3.0. Native addons built for Node 24 need a rebuild. The `-march=haswell` x64 build is gone — SIMD is now runtime-dispatched. For most projects, `bun upgrade` and a thorough test run covers it. The [official Bun 1.4 release post](https://bun.com/blog/bun-v1.4) has the full list.\n\n**Upgrade now** if you are on a greenfield project, running non-critical services, or want the performance wins in development. **Wait for 1.5** if you use Vue, Svelte, Astro, or Angular template checking — those frameworks depend on a stable programmatic API not landing until the next minor. Same advice if you rely heavily on native addons or run a production service with no staging environment.\n\n## The Bigger Picture\n\nBun 1.4 is the latest chapter in the Rust-ification of JavaScript tooling. OXC, Rolldown, SWC — the compile-and-run layer of the web stack is being rewritten in Rust one project at a time. Bun’s rewrite is the most ambitious of the lot: a complete runtime, not just a linter or bundler. That it shipped — even with rough edges — is significant. The edges will smooth out. The architecture will not change again.", "url": "https://wpnews.pro/news/bun-1-4-ships-the-rust-rewrite-what-got-faster", "canonical_source": "https://byteiota.com/bun-1-4-ships-the-rust-rewrite-what-got-faster/", "published_at": "2026-09-26 19:08:44+00:00", "updated_at": "2026-09-26 19:30:55.168858+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "artificial-intelligence"], "entities": ["Bun", "Bun 1.4", "Rust", "Zig", "Node 26", "Vercel", "Bun.WebView", "Scrydon"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/bun-1-4-ships-the-rust-rewrite-what-got-faster", "markdown": "https://wpnews.pro/news/bun-1-4-ships-the-rust-rewrite-what-got-faster.md", "text": "https://wpnews.pro/news/bun-1-4-ships-the-rust-rewrite-what-got-faster.txt", "jsonld": "https://wpnews.pro/news/bun-1-4-ships-the-rust-rewrite-what-got-faster.jsonld"}}