Why Bun Is So Fast
oct 17, 2026 · 5 min read · javascript, performance, bun
I switched to Bun from pnpm a while back. A normal pnpm install for me takes around 10 seconds, so the first time I ran bun install and it just... happened, instantly, I assumed it hadn't actually worked. So I ran it again.
You'd think someone just... wrote a faster package manager. The real answer is more boring and somehow more satisfying: Bun skips three kinds of work that npm and pnpm do on every single run. None of them is clever on its own. Stacked together, they add up fast.
Files get linked, not copied
This is the one I wish I'd known sooner.
When you install lodash in three projects, npm downloads the tarball and extracts a full copy into each project's node_modules. Same bytes, written to disk three times.
Bun keeps one copy in a global cache and points each project at it. On Linux and Windows that pointer is a hardlink — the "copy" is really just a new directory entry for the same file. On macOS it uses clonefile, which is copy-on-write: the clone shares the original's disk blocks until something actually modifies it. Writing a few bytes of directory metadata is dramatically cheaper than writing megabytes of package contents.
To be fair, pnpm already does this. I'm not going to pretend Bun invented it. So this is a big win against npm and only a small one against pnpm. The gap that remains is in the next two sections.
Metadata gets read, not parsed
This one's less obvious but maybe the most satisfying.
Every install starts with the registry. npm and pnpm talk to the npm registry, get back JSON, parse it into objects so they can figure out versions and dependencies, then throw those objects away. Next install, they parse the same JSON again.
Bun parses it once and writes the result to a binary file at ~/.bun/install/cache/<hash>.npm. After that, reading a package's metadata is pointer arithmetic: jump to a known byte offset, read a fixed number of bytes, done. No tokenizer, no allocations, no tree of objects to walk.
The cache lives for five minutes and Bun ignores the Cache-Control age headers the registry sends, so within that window repeat installs skip the network entirely.
Zig talks to the kernel directly
This is the nerdy one. But stick with me.
npm and pnpm are JavaScript programs running on Node. When they want to read or write a file they don't make the system call themselves — they hand the work to libuv, Node's I/O layer, which runs it on a thread pool and coordinates those threads with locks.
Bun is written in Zig and issues the system calls itself. That sounds like a small distinction until you count them. Tracing the same install: npm makes roughly 997,000 system calls and spends about 66.5% of them on futex — threads blocking while they wait on each other. Bun makes roughly 166,000, and only 0.46% are futex. Fewer calls, almost none of them just waiting around.
Full disclosure: those numbers are from Bun's own "Behind the scenes of bun install" blog post, not some independent audit. Take them with that in mind. But the shape makes sense: the cost isn't the copying, it's the coordination around the copying. And this is the part pnpm can't escape — it runs on Node and inherits libuv whether it wants to or not. The hardlink thing was basically a tie. This one isn't.
Bun is also a runtime
Everything above is about the package manager. But Bun also replaces Node itself, and it uses JavaScriptCore — the engine in Safari — instead of V8.
The two engines were built for different things. V8 has a heavy optimizing compiler that pays off once code has been running a while, which is great for long-lived servers. JavaScriptCore was tuned to start fast. For a script or CLI tool that runs for a few hundred milliseconds, startup time is basically the whole story, and Bun tends to be around 4x faster there.
Leave it running and the gap shrinks. V8's optimizer catches up, so a server that's been up for an hour isn't where Bun's advantage lives.
The part the benchmarks skip
All of this is Bun's default install, which hoists packages the way npm and Yarn do. Bun has an opt-in isolated mode that lays things out like pnpm — stricter isolation, more linking work. That mode is slower, and in at least one reported configuration, more than 50x slower. So "Bun is faster" really means "Bun's default mode is faster." Turn on the pnpm-style layout and you're giving some of it back.
And the "25x faster than npm" line on Bun's site comes from Bun's own benchmarks on fixtures they chose. The mechanisms — hardlinks, binary metadata cache, skipping libuv — hold up when you go read the docs and the source. The exact multiplier doesn't travel well outside their setup. I'd believe the architecture. The exact number, run it yourself on your own project.
Anyway, I've been using Bun for everything since. It's one of those tools where you install it once and then just... forget npm exists.