Writing

Technology · 7 min read

Dev Benchmarks: HDD to NVMe

What I’d move to NVMe after measuring Bun and pnpm installs, Cargo and Astro builds, lint and typechecking on my NAS.

In this article6 sections

NVMe was worth it for my development setup, mainly for installs and fresh builds. I’m keeping the code and build output there, and package caches are next. Lint and typechecking gave me little reason to buy faster storage.

These are measurements from my UGREEN DXP4800 Plus, following the Immich storage changes. I kept the HDD copy of my code so I could compare the same work on both drives.

I used ChatGPT Codex to run the benchmarks, keep the raw results and check the calculations. Getting these measurements is a lot easier than it used to be. I can try a change and see whether it helped, rather than convincing myself it feels faster because I bought something.

Installing packages

For installs, I separated downloading packages into an empty cache from reusing packages already on disk. The empty-cache test used a local mirror so internet speed wouldn’t decide the result.

pnpm benefited consistently. Bun’s typical install barely changed, although its average looked better on NVMe. One slow HDD run explains much of that difference, which is why the chart shows both averages and medians.

HDD versus NVMeEmpty package cache
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
HDDNVMe
Exact comparison values; change is relative to HDD.
DatasetHDD (s)NVMe (s)Change
bun average1.010.63-37.2%
bun median0.630.63-1.0%
pnpm average5.490.88-83.9%
pnpm median5.120.88-82.8%

Tap a point or use arrow keys to inspect values.

Ten pairs per manager, with project and cache on the same drive. Average and median shown separately. Packages come from an in-memory local mirror; OS caching stays enabled.

Reusing the downloaded packages changed the result for Bun. With the cache populated and node_modules removed, both tools were faster on NVMe in every pair.

HDD versus NVMeCached reinstall · mean
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
HDDNVMe
Exact comparison values; change is relative to HDD.
DatasetHDD (ms)NVMe (ms)Change
Bun94.621.7-77.0%
pnpm385.6140.5-63.6%

Tap a point or use arrow keys to inspect values.

Project and populated cache move together. node_modules is removed before each frozen offline install. Ten pairs, scripts disabled.

Moving the cache separately

Those install tests moved the project and cache together. My code was already on NVMe, so I tested the remaining change on its own: keep the project in place and move only a disposable package cache.

HDD versus NVMeMove only the cache · mean
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
HDD cacheNVMe cache
Exact comparison values; change is relative to HDD cache.
DatasetHDD cache (ms)NVMe cache (ms)Change
Bun99.618.9-81.1%
pnpm171.5119.6-30.3%

Tap a point or use arrow keys to inspect values.

The project stays on NVMe. Only the populated package cache changes volumes. node_modules is removed before each offline install.

Both tools improved in every pair. The savings are small in absolute terms, but I’d make this change now that the drive is already there.

Moving the cache also puts it on the same filesystem as the project. Packages can then be linked instead of copied across drives, as the Bun and pnpm documentation explains. The measured gain includes that change in how files are installed.

Cargo builds

I separated the source and build output in the Rust tests too. For Ratagrid, moving Cargo’s build directory helped fresh builds. Repeating the same commands with the artifacts retained left much less work for the drive.

HDD versus NVMeCargo workflow · mean
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
HDDNVMe
Exact comparison values; change is relative to HDD.
DatasetHDD (s)NVMe (s)Change
Fresh target30.6025.34-17.2%
Warm replay2.091.90-9.1%

Tap a point or use arrow keys to inspect values.

Earlier same-day target-only experiment. Source and registry stay fixed. Fresh means an empty target directory, with dependencies already downloaded.

Once both build directories were on NVMe, changing the source location barely affected the result. For Ratagrid, I’d prioritize the build directory over the source files.

Builds and everyday checks

The JavaScript results were more mixed. The Astro build improved modestly. Bunki’s site-generation test benefited more and produced identical HTML. Bun tests also improved, with the size of the gain varying between batches.

HDD versus NVMeBuilds and typecheck · mean
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
HDDNVMe
Exact comparison values; change is relative to HDD.
DatasetHDD (s)NVMe (s)Change
Astro build5.395.06-6.1%
Bun tests4.544.22-7.0%
Typecheck2.742.74-0.3%
Site generation1.541.12-27.2%

Tap a point or use arrow keys to inspect values.

Ten alternating pairs. Lower is faster. Individual timings and p95 values are linked below.

Typechecking barely changed. That was also true of the shorter commands, including install checks with dependencies already present.

HDD versus NVMeSmall checks · median
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
Static paired comparison. Gap labels show the difference; all exact values are in the accompanying table.
HDDNVMe
Exact comparison values; change is relative to HDD.
DatasetHDD (ms)NVMe (ms)Change
Bun installed8.87.8-11.7%
pnpm installed64.964.1-1.1%
Form lint165.8167.4+1.0%
View lint114.7114.8+0.0%
View types214.9215.1+0.1%
Bun build294.3293.4-0.3%

Tap a point or use arrow keys to inspect values.

Installed rows are offline install checks with node_modules retained. Other rows are the earlier workspace comparison with dependencies installed. Ten pairs per workload.

For those commands, moving to NVMe mostly changed where the files lived. I wouldn’t spend money on faster storage to improve them.

Was NVMe worth it?

Yes. I’d move the build output and package caches first. Fresh Cargo builds improved, and both Bun and pnpm benefited from having cached packages on NVMe. Moving the cache helped even after the code was already there. That’s the next change I’d make on this NAS.

Site builds also got faster, though the improvement depended on the project. Bunki benefited more than Astro. Moving Rust source files alone did much less once the build directory was already on NVMe, so I wouldn’t make moving the code folder the whole plan.

I wouldn’t buy NVMe just to make lint or typechecking faster. Those barely changed, as did Bun’s artifact build and install checks with dependencies already present. Warm Cargo runs had much less to gain too. And while pnpm’s empty-cache installs improved consistently, Bun’s typical run didn’t. Its average looked better largely because of one slow HDD run.

I’m keeping the NVMe. There’s enough improvement here to make it useful, even though some commands take just as long. The NAS recorded swap activity during testing, which brings me back to my original thought about RAM. Those counters cover the whole host, so I’d want to measure that separately before buying more memory.

How I measured

Each comparison used ten alternating HDD/NVMe pairs. The HDD pool is a Btrfs mirror and the NVMe volume is a single ext4 drive. The NAS stayed in use, with OS file caching enabled.

The install fixture used eight pinned development dependencies from Viewability. Each manager had its own frozen lockfile. Cached reinstalls and already-installed checks ran offline. Install scripts were disabled. Each manager is compared against itself, with internet download time excluded.

Cargo’s fresh runs used an empty target directory with dependencies already downloaded. They ran Clippy, tests, doctests and documentation, then repeated without source changes. The separate source-location test used the lean CI profile, so I only compare drives within each experiment. The JavaScript build and check tests used installed dependencies and a warmup before timing.

Bun reported 1.4.5, with install build 1.4.5-canary.1; pnpm was 12.18.0. The install tests used disposable caches. My live caches and tool executables are still on HDD.

Every sample is retained, including the slow ones. With ten observations, nearest-rank p95 is the slowest run. Download the install measurements and fixture, or the build, lint and typecheck measurements for individual timings, averages, medians and p95 values.

Was this useful?

What was missing?

Thanks for the feedback.