# How fast does a Space fork from a checkpoint?

A QEMU VM Space forked from a checkpoint holding 300 MB in RAM and 100 MB on disk answered its first command 328.8 ms after the fork call (p50, n = 30) on a Mac Studio (Apple M2 Max, 96 GB), measured 2026-10-25 on Cua Spaces 0.15.0.

- Page: https://cua.ai/benchmarks/fork-from-checkpoint
- Measured: 2026-10-25
- Raw data: https://cua.ai/benchmarks/fork-from-checkpoint.csv
- build Cua Spaces 0.15.0 DMG (https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg, sha256 8725a09ba4132aa8a1667fa48c86416c91d5dec0d3c7dc93f88f5f3e29e0aba0): bundled cua 0.9.0, Helpers/cua-spacesd 0.8.0, cua-vz; n = 30

## Results

Time from the fork call until the fork answers its first command, serial. Lower is better.

| Measure | Value |
| --- | --- |
| Fastest | 225.5 ms |
| p50 | 328.8 ms |
| p90 | 411.8 ms |
| p99 | 447.9 ms |
| Slowest | 447.9 ms |

## Method

Driver on the host: `rollout_bench` (Rust SDK, built from the tag) against this release's daemon. A QEMU Linux VM Space (2 vCPU / 2 GiB, headless, created `--forkable` so its RAM is a shareable file) gets a world: 300 MB of random data in /dev/shm (guest RAM) and a 100 MB file on disk. Then a pinned memory+disk checkpoint (`Sandboxes.checkpoint`). Each sample = `Sandboxes.fork(checkpoint)` start → the fork's cua-spacesd answers a first `sh -c true` (fork + attach + first exec). n=30, serial, each fork deleted after its sample. A separate fork verified the world (`test -s /dev/shm/state && test -s ~/state.bin`: state-ok). Extra: 10 batches of `fork_many` x16 (16 forks started at once).

## Environment

- Machine: Mac Studio, Mac14,13 (Mac Studio)
- Chip: Apple M2 Max, 12 cores
- Memory: 96 GB
- OS: macOS 26.6.2 (25G83)
- Where: local
- Other vms: 1
- Network: n/a (local)
- Kind: vm
- Image: ghcr.io/trycua/linux:24.04-slim (QEMU disk)
- Shape: 2 vCPU, 2 GiB, --headless, --forkable
- Build: Cua Spaces 0.15.0 DMG (https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg, sha256 8725a09ba4132aa8a1667fa48c86416c91d5dec0d3c7dc93f88f5f3e29e0aba0): bundled cua 0.9.0, Helpers/cua-spacesd 0.8.0, cua-vz
- App: 0.15.0
- cua: 0.9.0
- cua_spacesd: 0.8.0

## Caveats

- QEMU VM kind. A gVisor fork from a checkpoint, n = 10, took p50 301 ms and p95 1,939 ms.

## Reproduce

```sh
# On an Apple silicon Mac (macOS 26), with Rust (rustup) and git:
curl -fLO https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg
hdiutil attach -nobrowse -mountpoint /tmp/cua-dmg cua-spaces-0.15.0-darwin-universal.dmg
mkdir -p ~/bench && ditto "/tmp/cua-dmg/Cua Spaces.app" ~/bench/"Cua Spaces.app" && hdiutil detach /tmp/cua-dmg
git clone --depth 1 --branch cua-spaces-v0.15.0 https://github.com/trycua/cua ~/bench/cua
(cd ~/bench/cua/libs/cua && cargo build --locked --release -p cua-sdk --example rollout_bench --example channel_bench)
export PATH="$HOME/bench/Cua Spaces.app/Contents/MacOS:$PATH" CUA_HOME=~/bench/home DO_NOT_TRACK=1 CUA_TELEMETRY=0
RB=~/bench/cua/libs/cua/target/release/examples/rollout_bench
cua daemon start --foreground &
$RB create --prefix fsrc- --n 1 --kind vm --cpus 2 --memory-mb 2048 --headless --forkable --keep
cua sb exec fsrc-0 'dd if=/dev/urandom of=/dev/shm/state bs=1M count=300; dd if=/dev/urandom of=$HOME/state.bin bs=1M count=100; sync'
$RB checkpoint --source fsrc-0 --name ckq-1 --pin
$RB fork --source ckq-1 --prefix fq- --n 30 --conc 1                    # serial forks, each deleted after its sample
for r in $(seq 1 10); do $RB fork-many --source ckq-1 --prefix fm$r- --n 16 --conc 16; $RB delete --prefix fm$r- --conc 16; done
```

## Questions

### Does the fork keep the running state?

Yes. A separate fork checked that the 300 MB in /dev/shm (RAM) and the 100 MB file on disk were there.

### What about many forks at once?

Ten batches of 16 forks started at once took 2,768 ms of wall time per batch at the p50.

### Can I run this myself?

Yes. The commands under Reproduce use the published Cua Spaces 0.15.0 release and the public trycua/cua repository at the tag cua-spaces-v0.15.0. A `cua bench run` command that wraps them is coming; it isn't in a release yet.
