pnpm 12 vs Bun 1.4: Both in Rust Now, and Each Wins a Different Install
The 60-second version of this test. Subscribe on YouTube
pnpm 12 is a rewrite of pnpm in Rust. The release post says it keeps pnpm 11’s commands, settings and lockfile format, and on npm the latest tag now points to 12.21.0, published on November 13. So the next npm i -g pnpm on a fresh machine gets the Rust version.
Bun has been the speed reference for package installs since its first release, and Bun 1.4 is written in Rust as well (Bun’s post). The obvious question is which one installs faster now. The public numbers don’t answer it. Socket’s write-up of Vercel’s benchmark compared pnpm 12 only with pnpm 10, and it notes that pnpm removed Bun and Yarn from its own benchmark page after fixing problems in its setup.
So I ran it myself: the same real application, the same machine, four install scenarios, both tools interleaved run by run. The answer splits in two.
The Setup
- Machine: a 4 vCPU cloud container (Intel Xeon @ 2.10 GHz, 15 GB RAM, ext4 disk), Linux x86-64.
- pnpm 12.21.0, the native
@pnpm/exe.linux-x64binary called directly, with no Node.js wrapper. - Bun 1.4.4 (
bun install, default hoisted linker, plus a second round with--linker isolated). - Baseline: pnpm 11.28.12, the last JavaScript pnpm, run on Node.js 22.23.4.
- The app: the
package.jsonof Outline, the open-source wiki, at commitb73fd50(November 17, 2026). That’s 214 dependencies and 68 devDependencies: Koa, React 19, Sequelize, ProseMirror, the AWS SDK, Vite, Vitest. Outline uses Yarn, so neither tool gets a home advantage. I kept onlyname,version,dependenciesanddevDependencies, and dropped the Yarn-specificresolutionsblock. - Each tool has its own cache folder (
--store-dirand--cache-dirfor pnpm,BUN_INSTALL_CACHE_DIRfor Bun), on the same disk as the project so hard links work. - Lifecycle scripts are off on both sides (
--ignore-scripts), so I’m timing the package manager, notnode-gyp.
Each tool generated its own lockfile once, and every lockfile scenario installs from it with --frozen-lockfile. Bun installed 1,630 packages. 275 of the 282 direct dependencies resolved to the same version on both sides. The other 7 (five @aws-sdk/* packages, prosemirror-transform and @firecrawl/pdf-inspector) got a newer patch or minor release on Bun’s side, because those versions were published in the few minutes between the two resolutions. After every install I loaded react and koa from the result to check that node_modules actually worked.
The four scenarios:
| Scenario | Lockfile | Cache | node_modules | Real-world case |
|---|---|---|---|---|
| Fresh | no | empty | no | First install on a new project |
| Cold | yes | empty | no | CI without a cache, new laptop |
| Warm | yes | full | no | CI with a restored cache, rm -rf node_modules |
| No-op | yes | full | yes | Running install again “just in case” |
The harness, trimmed. It times each install and reads the process’s peak memory from os.wait4():
import os, time, shutil, subprocess
def run(cmd, work, env, wipe_cache, cache_dir):
if wipe_cache:
shutil.rmtree(cache_dir, ignore_errors=True)
os.sync(); time.sleep(8) # let the previous run's deletes settle
t0 = time.perf_counter()
p = subprocess.Popen(cmd, cwd=work, env=env, stdout=subprocess.DEVNULL)
_, status, usage = os.wait4(p.pid, 0)
assert status == 0
return time.perf_counter() - t0, usage.ru_maxrss / 1024 # seconds, MB
The commands:
# pnpm 12 (native binary) and pnpm 11 (node pnpm.cjs), same flags
pnpm install --frozen-lockfile --ignore-scripts \
--store-dir "$CACHE/store" --cache-dir "$CACHE/meta"
# Bun 1.4.4
BUN_INSTALL_CACHE_DIR="$CACHE" bun install --frozen-lockfile --ignore-scripts
The 8-second pause matters. Without it, my first warm round got slower with every run, because each run starts by deleting a 1,600-package node_modules folder and the disk was still busy with it when the next install began. Warm and no-op rounds have one discarded warm-up run, then 7 measured runs. Cold and fresh rounds download everything from registry.npmjs.org, so I ran 5 and 3. The tool order alternates every run, so a slow moment on the network doesn’t always hit the same tool.
Round 1: Cold Installs, pnpm 12 Wins
Empty cache, everything comes over the network.
| Scenario | pnpm 12.21 | Bun 1.4.4 | pnpm 11.28 |
|---|---|---|---|
| Cold, with lockfile (median of 5) | 8.45 s | 14.30 s | 14.71 s |
| Range | 6.31–10.56 s | 11.09–14.64 s | 13.62–16.87 s |
| Fresh, no lockfile (median of 3) | 10.45 s | 17.31 s | 20.14 s |
| Range | 8.38–10.89 s | 14.83–18.57 s | 19.52–21.88 s |
This was the surprise. In both rounds, every pnpm 12 run beat every Bun run: about 1.7x faster cold, with and without a lockfile.
It costs memory, though. pnpm 12 peaked at 1,016 MB on the cold install and 1,501 MB on the fresh one. Bun peaked at 260 MB and 383 MB. The JavaScript pnpm 11 was in between on time and close to pnpm 12 on memory (944 MB and 1,264 MB). I didn’t profile why pnpm 12 is faster here, so I won’t guess.
One honest caveat: these rounds measure my network as much as the tools. In an earlier 3-run cold batch, with a 3-second pause between runs instead of 8, the spread was much wider and one Bun run finished in 6.1 s. The medians pointed the same way, but on your network the gap could be smaller or larger.
Round 2: Warm Cache, Bun Wins
The cache is full, node_modules is gone. This is the CI job that restores a cache, and the developer who deletes node_modules to fix something.
| Warm install (median of 7) | Time | Range | Peak memory |
|---|---|---|---|
| Bun 1.4.4 | 0.40 s | 0.36–0.44 s | 20 MB |
Bun 1.4.4 --linker isolated | 0.42 s | 0.36–0.56 s | 21 MB |
| pnpm 12.21 | 1.24 s | 1.05–1.97 s | 367 MB |
| pnpm 11.28 | 3.68 s | 3.13–4.27 s | 476 MB |
Bun builds a working node_modules for 1,630 packages in 0.4 seconds, 3.1x faster than pnpm 12, and it does it in 20 MB of memory. That number looked wrong to me, so I checked it a second way, by polling VmHWM in /proc/<pid>/status during a run: 20.5 MB, 7 threads, no child processes.
The --linker isolated row is the fairer comparison, because it gives Bun pnpm’s layout: packages in a hidden store folder, with symlinks, and no phantom dependencies. It costs Bun almost nothing, 0.42 s against 0.40 s. So the layout doesn’t explain pnpm’s gap.
pnpm 12 is still 3x faster than pnpm 11 here. If you upgrade pnpm and change nothing else, your cached CI installs get about 2.4 seconds shorter on an app this size.
Round 3: No-op Install, Bun Wins Again
Everything is already installed. Run install again.
| No-op install (median of 7) | Time | Range | Peak memory |
|---|---|---|---|
| Bun 1.4.4 | 0.055 s | 0.050–0.072 s | 20 MB |
Bun 1.4.4 --linker isolated | 0.051 s | 0.046–0.062 s | 21 MB |
| pnpm 12.21 | 0.214 s | 0.165–0.243 s | 119 MB |
| pnpm 11.28 | 0.643 s | 0.605–0.725 s | 160 MB |
Bun is about 4x faster than pnpm 12. In an earlier 5-run round with a 3-second pause, pnpm 12 measured 0.108 s and Bun 0.070 s, so the exact gap moves, but the order never did. Both are fast enough that you won’t feel it by hand. You’d feel it in a pre-run check that calls install before every script.
Disk Usage: A Tie
With everything installed, I measured the cache and node_modules together with a single du, so hard-linked files count once:
| Cache + node_modules | |
|---|---|
| Bun 1.4.4 | 1.2 GB |
| pnpm 12.21 | 1.3 GB |
| pnpm 11.28 | 1.4 GB |
On ext4, both tools hard-link from their cache into the project, so a second project that uses the same packages costs very little extra on either side. This is not a reason to pick one.
The Comparison
| pnpm 12.21 | Bun 1.4.4 | |
|---|---|---|
| Cold install, lockfile | 8.45 s | 14.30 s |
| Fresh install, no lockfile | 10.45 s | 17.31 s |
| Warm-cache install | 1.24 s | 0.40 s |
| No-op install | 0.214 s | 0.055 s |
| Peak memory, cold | 1,016 MB | 260 MB |
| Peak memory, warm | 367 MB | 20 MB |
| Lockfile | pnpm-lock.yaml v9, same as pnpm 11 | bun.lock |
| Needs a JS runtime | No | It is one |
| Strict (isolated) layout | Default | --linker isolated (this project defaulted to hoisted) |
Where pnpm 12 Wins
Cold installs. CI without a dependency cache, Docker builds that start from an empty layer, new machines. That’s 1.7x in my runs, and it’s also the case where installs take the longest, so the seconds saved are real.
Migration cost: zero. pnpm 12 kept lockfile format 9.0. Both lockfiles I generated, from pnpm 11 and pnpm 12, start with lockfileVersion: '9.0', and pnpm 12 installed this app with the same flags as pnpm 11. Read the breaking changes before upgrading, though: --frozen-lockfile false is gone, and engineStrict now fails some installs that pnpm 11 only warned about.
Workspaces and a stricter layout by default. pnpm’s isolated node_modules, catalog: versions and workspace filtering are why many monorepos use it. Bun has workspaces too, but switching package managers in a large monorepo is a project of its own, and this benchmark doesn’t measure that.
No runtime commitment. pnpm 12 is a standalone binary. Choosing Bun as a package manager also puts a 107 MB runtime on every machine and image, even if you never run code with it.
Where Bun Wins
Anything with a warm cache. Restored CI caches, rm -rf node_modules && install, switching branches. 3x faster than pnpm 12, every run.
Memory. 20 MB instead of 367 MB warm, and 260 MB instead of about 1 GB cold. On a small CI runner or a container with a memory limit, that difference is the one that can fail a build.
Repeated installs. At 55 ms, you can run bun install before every script and not notice it.
You already run Bun. Then the question answers itself.
Decision Table
| Your situation | Pick |
|---|---|
| Already on pnpm | Upgrade to pnpm 12. 1.7x faster cold and 3x faster warm than pnpm 11, same lockfile |
| CI without a dependency cache, or fresh Docker layers | pnpm 12 |
| CI with a cache restore, or runners with little memory | Bun |
| Large pnpm monorepo with catalogs and filters | pnpm 12, the switching cost is bigger than the seconds |
| Already using Bun as a runtime | Bun |
| npm user wondering which to try | pnpm 12 if you don’t want a new runtime; Bun if you do |
The Verdict
It splits on one thing: is your cache warm? With an empty cache, pnpm 12 won every cold and fresh run, about 1.7x faster than Bun. With a warm cache or an existing node_modules, Bun won every run, 3x to 4x faster, using a fraction of the memory.
On a dev machine, most installs happen with a warm cache, so for the inner loop, Bun is still the fastest installer I’ve measured. But the old idea that Bun beats pnpm everywhere no longer holds. On an empty cache, the Rust pnpm is faster.
The clearest result is the boring one: if you use pnpm, upgrade to 12. It was faster than pnpm 11 in every scenario, by 1.7x to 3x, with the same lockfile and the same commands.
Caveats: one app (282 direct dependencies), one 4-core Linux machine on ext4, lifecycle scripts off, and network rounds that depend on my connection to the npm registry. I didn’t test macOS, where both tools clone files instead of hard-linking them, or a large workspace. If installs matter to your CI bill, time install --frozen-lockfile with both tools on your own lockfile. That takes about five minutes.
Related Articles
More TypeScript tooling clashes:
- bun fmt vs Prettier 3.10: 697 TypeScript Files, Identical Output, 45x Faster — Bun’s other new built-in tool, against the JavaScript incumbent.
- Vitest 5 vs Jest 30: Jest Won My Benchmark Until I Changed One Flag — The same “same code, both tools, median of runs” method, applied to test runners.
- TypeScript 7 in Monorepos: tsgo with Turborepo, Nx, and pnpm Workspaces — Where pnpm workspaces fit in a TypeScript monorepo.
Enjoying the content? Here are tools I personally use and recommend:
- 🌐 Hosting: Bluehost — simple hosting for a WordPress or PHP site
- 🛒 Tech Gear: My Amazon Store — keyboards, monitors, dev tools I use
Purchases through my links help keep this blog ad-free 💙
Enjoyed this post?
Every clash gets a video: two tools, one real task, a measured winner.
▶ Subscribe on YouTube 🎬 All videos