Bun 0.7.1 released, 1.0 promised for September 7th

Bun 0.7.1 released, 1.0 promised for September 7th

Bun, a JavaScript runtime based on Zig and JavaScript Core, has reached version 0.71, with version 1.0 promised on September 7th this year.

Performance is a key feature of the new open source runtime, which competes with the long-established Node.js as well as the more recent Deno. In version 0.71, EcmaScript (ES) modules load from 30 percent to 250 percent faster, according to the post from creator Jarred Sumner. This is achieved by making the Bun transpiler run concurrently. It does not apply to CommonJS modules loaded with the “require” keyword. Sqlite database performance is improved by 10 percent in this release.

The Bun team is focused on improving support for frameworks powered by Vite, and there are numerous fixes in this version. “Previously, vite dev would spin up 11 threads to watch files. Now, it only needs 1 thread,” the release notes state.

Web API compatibility is improved in this release, with support for MessagePort and MessageChannel, using the WebKit/Safari implementation, enabling messages to be passed between different browsing contexts in the same document, such as between iFrames or Web Worker background processes. BroadcastChannel will be in the next update. Bun now uses the WebKit URL parser for implementing fetch(), fixing some bugs.

“One of the reasons why Bun bet on JavaScriptCore instead of embracing the server-side V8 monoculture is because JavaScriptCore and WebKit/Safari are strongly tied together. This means that Bun can often use implementations of Web APIs from WebKit/Safari directly, without having to reimplement them,” said Sumner.

Bun running in Windows Subsystem for Linux, the only way to use it on Windows

How complete will Bun be when 1.0 appears? The roadmap shows 61 of 137 tasks completed, though not everything here was promised for 1.0. It looks like the focus is on specific frameworks, Next.js and Vite, with strong SQLite support. Windows support is problematic, other than via WSL (Windows Subsystem for Linux). “Building JavaScriptCore needs to work on Windows and the JIT tiers need to work. I don’t know what the current status of this is,” the notes state. Apple’s Webkit and Safari developers have little incentive to address this.

Despite those limitations, Bun’s benchmarks are good enough to attract attention. The current claim is that Bun can perform server-side rendering with React five times faster, in requests per second, than Node.js and more than twice as fast as Deno. Bun’s Sqlite client is three times faster than better-sqlite3, according to its benchmarks, and 75 percent faster than Deno. No doubt the Bun team is selective though about the benchmarks it uses; the Deno team shows Sqlite results that slightly out-perform Bun. Real-world performance is often very different from benchmarks that repeat simplistic operations in a tight loop.

It will not be until Bun is declared production-ready that we get a sense of how significant it will be.