Skip to content

Performance Results

Benchmark results from Capsem v0.14.6 running on Apple M4 Max (macOS 15.4). All measurements taken inside the guest VM using capsem-bench and boot timing instrumentation.

Total time from VM start to shell ready: ~580ms.

StageDurationDescription
squashfs10msMount compressed rootfs from virtio block device
virtiofs<1msMount VirtioFS shared directory
overlayfs80msCreate ext4 loopback overlay (format + mount)
workspace<1msBind-mount /root from VirtioFS
network210msConfigure dummy0, dnsmasq, iptables rules
net_proxy100msStart TCP-to-vsock HTTPS proxy
deploy10msCopy tools from initrd to rootfs
venv170msCreate Python virtualenv (via uv)
agent_start<1msLaunch PTY agent, connect vsock
Total~580ms

The diagnostic suite enforces boot time stays under 1 second. The two heaviest stages are network setup (iptables rule installation) and venv creation.

Scratch disk performance on the VirtioFS-backed workspace (/root). Test size: 256MB.

TestThroughputIOPSDuration
Sequential write (1MB blocks)1,180 MB/s-217ms
Sequential read (1MB blocks)3,425 MB/s-75ms
Random 4K write (fdatasync)33 MB/s8,3251,201ms
Random 4K read188 MB/s48,070208ms

Sequential I/O benefits from VirtioFS pass-through to APFS. Random write IOPS are limited by per-write fdatasync — this reflects the worst case for database-style workloads.

Read-only squashfs rootfs where binaries and libraries live.

TestDetailThroughputIOPSDuration
Sequential read (1MB)codex binary (146MB)727 MB/s-201ms
Random 4K read4,215 files sampled18 MB/s4,7041,063ms

Squashfs decompression adds overhead compared to the scratch disk. Random reads across many small files show the cost of decompression + inode lookup on a compressed filesystem.

Wall-clock time to run <cli> --version with page cache dropped (3 runs, best/mean/worst).

CLIMinMeanMax
python38ms9ms11ms
node136ms138ms139ms
claude291ms310ms346ms
gemini1,385ms1,386ms1,389ms
codex284ms288ms291ms

Python starts near-instantly. Node-based CLIs (claude, codex) take ~300ms. Gemini’s startup includes a Java-like warm-up phase at ~1.4s.

50 GET requests to https://www.google.com/ with concurrency 5, routed through the MITM proxy.

MetricValue
Requests50/50
Requests/sec58.3
Transfer3.8MB
Total duration858ms
Latency percentileValue
min56ms
p5067ms
p95250ms
p99253ms
max254ms

Latency includes the full path: guest -> net-proxy -> vsock -> host MITM proxy -> TLS termination -> internet -> re-encryption -> response. The p50 of 67ms reflects mostly internet RTT; the p95 tail is TLS session setup on new connections.

100MB file download through the MITM proxy.

MetricValue
Downloaded100MB
Duration2.9s
Throughput34.3 MB/s

This is the sustained bandwidth ceiling for the proxy pipeline (TLS termination + body inspection + re-encryption). Actual throughput varies with internet connection speed.

End-to-end latency for snapshot operations via the MCP gateway at 3 workspace sizes. Each operation is a full round-trip: guest CLI -> vsock -> host gateway -> APFS filesystem -> response.

OperationLatency
create879ms
list363ms
changes376ms
revert373ms
delete367ms
OperationLatency
create390ms
list367ms
changes377ms
revert377ms
delete400ms
OperationLatency
create394ms
list443ms
changes366ms
revert421ms
delete411ms

The 10-file create is slower than 100/500 because it includes the first MCP handshake (JSON-RPC initialize). Subsequent operations reuse the connection. List and changes scale modestly with file count. The host gateway-side latency is typically 3-20ms — the rest is vsock + MCP protocol overhead.

ComponentVersion
HostmacOS 15.4, Apple M4 Max
Capsemv0.14.6
Guest kernelLinux 6.x (custom allnoconfig)
StorageVirtioFS mode (APFS backing)
Python3.x (rootfs)
Nodev22.x (rootfs)
Terminal window
just bench # Run all benchmarks (~2 min)

Results are displayed as rich tables in the terminal. JSON output is saved to /tmp/capsem-benchmark.json inside the VM.