Skip to content

X05 - Filesystem benchmark

Brief: B19-fs-benchmarkB19-fs-benchmark: Is the data disk fast enough, and which disk settings does it use?No.

Purpose: The result of the spike for I19I19 (closed): X05-fs-benchmark: Filesystem benchmarkHow does the data disk perform with default versus relaxed write-through settings, against the host, on the NFR02-fs-speed workloads?. How does the data disk perform with default versus relaxed write-through settings, against the host, on the NFR02-fs-speedNFR02-fs-speed: FilesystemThe workspace is on guest-native storage. workloads?

From X00-indexX00-index: SpikesThe open questions that must be answered by a throwaway prototype before work builds on them, in the order they are taken up.: data disk with default versus relaxed write-through settings, against the host, on the NFR02-fs-speedNFR02-fs-speed: FilesystemThe workspace is on guest-native storage. workloads. The issue asks for each combination of caching mode and synchronization mode of VZDiskImageStorageDeviceAttachment, on an ASIF and a raw image, each workload five times warm and cold in the guest and on the host, and a kill of the VM process mid-write in the relaxed modes.

No. NFR02-fs-speedNFR02-fs-speed: FilesystemThe workspace is on guest-native storage. asks for at least 80% of host throughput on npm ci, git status on a large repository, and an incremental build. With 4 vCPU, the S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does. default, and the setting chosen here (raw image, automatic caching, full sync), the warm guest reached:

Workload Host p50 Guest p50 Share of host
npm ci 2.33 s 3.26 s 71%
git status, 43k files 0.250 s 0.182 s 137%
Go incremental build 0.439 s 0.542 s 81%

The answer is the same for every disk setting:

  1. The sync mode doesn’t matter for these workloads. Across all 13 settings with 4 vCPU, npm ci took 3.08 s to 3.60 s (65% to 75%), git status 0.179 s to 0.205 s, and the Go build 0.533 s to 0.613 s (72% to 82%), with no order by mode. These workloads issue few flushes. The sync mode only shows where a program flushes after each write: 500 appends with fsync took 1.50 s to 2.05 s with full sync, 0.66 s to 1.22 s with the fsync mode, and 0.20 s to 0.49 s with no sync, against 1.28 s on the host.
  2. npm ci stays under the target even without a virtual disk. On an APFS volume on a guest RAM disk it took 3.03 s, 77% of the host. The virtual disk costs 8% on top of that with the chosen setting. With 8 vCPU it was slower on this loaded host (3.65 s). Why the guest creates 17,000 files more slowly than the host, and whether the vCPU count plays a part, is open (I97I97 (open): npm ci in a macOS guest runs at 71% of host speed with every disk settingX05-fs-benchmark (#19) found that npm ci in a macOS guest reaches only 71% of host throughput with the chosen data disk setting (raw image, automatic caching, full sync), below the 80% of NFR02-fs-speed.).
  3. ASIF and raw perform alike (npm ci 3.46 s and 3.26 s with automatic caching and full sync). But a raw image gives space back to the host when the guest deletes data, and an ASIF image doesn’t: 1 GiB written and deleted in the guest left the ASIF image 1 GiB larger, and the raw image back where it started within 30 s. Over the benchmark, the 16 GB ASIF image grew to 11.7 GB on the host (observed with ls -s before it was deleted, not kept in the results). That makes raw the choice for NFR03-footprintNFR03-footprint: FootprintIdle VMs suspend after a configurable period..

Killing the VM mid-write lost nothing that the guest had flushed, in every mode tried. Six runs, on the raw image with automatic caching and full sync, automatic caching and no sync, and host caching and no sync, killed either this spike’s wb-vmd stand-in or the Virtualization service process that held the image. After each, fsck_apfs found the volume clean, every acknowledged record was intact, and at most the one file written after the last flush was missing. A killed process leaves its writes in the host’s memory, so this test can’t tell the modes apart. A host crash or power loss can, and for that Apple’s header is the source: with no sync, “the disk image cannot safely be reused on failure”, and the fsync mode is “best-effort” and doesn’t flush the drive’s cache. Only full sync keeps flushed writes, which is what I44I44 (closed): S06-vm-lifecycle: data disk durability, and never mount a guest-written diskS06-vm-lifecycle says the data disk "can be rebuilt from host state plus git, so it may use relaxed write-through settings for speed". decided Claude Code state and commits not yet pushed need.

Host: Apple M2 (4 performance and 4 efficiency cores), 16 GB, macOS 27.0.1, FileVault on, one Endpoint Security extension active (a file sync client), load average 3 to 4 from other agents’ work. Guest: macOS 27.0.1, 4 vCPU, 8 GiB, provisioned with VZMacGuestProvisioningOptions, a 16 GB data disk formatted APFS in the guest with Spotlight off. Both ran the same node 24.21, npm, Apple git 2.54 and Go 1.27.1 binaries.

Workloads, on the data disk in the guest and in ~/Library/Caches on the host, both excluded from Spotlight:

  • npm ci --offline: the docs site’s dependencies, 536 packages, 17k files, 317 MB, from a full npm cache on the same disk.
  • git status in a shallow clone of nodejs/node v24.9.0: 43k files, 814 MB.
  • Go incremental build: go build of a gVisor-based program with its modules vendored, after changing one file. Also a clean build with an empty build cache.
  • Probes of the sync modes: 500 appends of 4 KiB, each followed by fsync (node’s libuv issues F_FULLFSYNC on macOS), and 512 MiB of sequential writes with one fsync at the end.

Each workload ran five times warm per setting, after one run to settle, and five times cold, after purge in the guest, which drops the guest’s file cache (and with it the toolchain on the system disk). The host can’t run purge without a password, so it has no cold runs. The host ran the workloads after each guest setting, with no VM running: 75 runs per workload, 15 for the clean Go build, which runs once per set. The ASIF automatic/full row has 10 warm runs: the probe boot before the matrix has the same label and stats.py counts both. Medians, warm:

Setting npm ci git status Go incremental Go clean 500 × fsync
Host 2.33 s 0.250 s 0.439 s 5.20 s 1.28 s
raw, automatic, full 3.26 s 0.182 s 0.542 s 8.65 s 2.05 s
raw, automatic, fsync 3.44 s 0.190 s 0.540 s 9.18 s 0.66 s
raw, automatic, none 3.31 s 0.184 s 0.545 s 9.00 s 0.49 s
raw, cached, none 3.08 s 0.193 s 0.613 s 9.75 s 0.20 s
ASIF, automatic, full 3.46 s 0.194 s 0.564 s 9.11 s 1.78 s
ASIF, cached, full 3.60 s 0.191 s 0.607 s 10.49 s 1.65 s
ASIF, uncached, full 3.33 s 0.205 s 0.605 s 8.58 s 1.50 s
ASIF, cached, none 3.33 s 0.185 s 0.605 s 11.59 s 0.25 s
ASIF, uncached, none 3.17 s 0.193 s 0.549 s 9.76 s 0.35 s
guest RAM disk 3.03 s 0.203 s 0.564 s 7.80 s
raw, automatic, full, 8 vCPU 3.65 s 0.192 s 0.575 s 7.63 s 1.94 s

The other four ASIF settings, the cold runs, the sequential writes and the spread of each set are in results/stats.txt on the spike branch. Cold, with the chosen setting, the guest took 4.51 s for npm ci, 0.579 s for git status and 2.05 s for the Go build. The host has no cold number to compare them with.

  • The host baseline can be off in both directions. The host’s 75 npm ci runs spread from 2.29 s to 2.60 s, and the guest’s from 2.99 s to 4.94 s. Load from other agents may slow the 4-vCPU guest more than the mostly single-threaded host run, so a quiet host could raise the guest’s share (best single runs: 77.6% on the data disk, 82.6% on the RAM disk). FileVault and the Endpoint Security extension add work to every file operation on the host and none in the guest, whose data volume isn’t encrypted. That may be why git status is faster in the guest. A host without them would set a higher bar.
  • Throughput of the flush probe in the kill runs (one record append with F_FULLFSYNC plus one 64 KiB file per step): 211 steps per second with full sync, 671 with no sync, 1,230 with host caching and no sync.
  • ASIF works with VZDiskImageStorageDeviceAttachment, though the header of the macOS 27 SDK says only raw images are supported. Its advantage over a raw sparse file is moving between machines, which a data disk doesn’t do.

A host crash or power loss. Only a process kill was tested. The settings for a host crash rest on Apple’s headers (VZDiskImageStorageDeviceAttachment.h, VZDiskSynchronizationMode.h).

Cold runs on the host, for want of purge without a password.

Claude Code’s own writes. Whether Claude Code flushes its state files, and how often, wasn’t checked. If it flushes after each write, full sync costs it about 4 ms per flush in the guest, against about 2.6 ms on the host.

NVMe. The data disk was a virtio block device. The NVMe controller was not tried.

Homes on a second disk and their survival through a system disk swap are X08-data-diskX08-data-disk: Data disk for homesGuest user homes on a second disk, surviving a system-disk replacement..

Branch spike/x5-fs-benchmark, at ec6ffea: the wb-vmd stand-in with the data disk settings, the benchmark, the kill and trim tests, and the raw results with results/stats.txt.

Status: Answered 2026-10-05: no. NFR02-fs-speedNFR02-fs-speed: FilesystemThe workspace is on guest-native storage. is not met for npm ci with any disk setting, and the data disk uses full sync. Decided 2026-10-06 (I19I19 (closed): X05-fs-benchmark: Filesystem benchmarkHow does the data disk perform with default versus relaxed write-through settings, against the host, on the NFR02-fs-speed workloads?): NFR02-fs-speedNFR02-fs-speed: FilesystemThe workspace is on guest-native storage. is a goal outside the release gate