{
  "slug": "fork-from-checkpoint",
  "question": "How fast does a Space fork from a checkpoint?",
  "answer": "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.",
  "status": "measured",
  "url": "https://cua.ai/benchmarks/fork-from-checkpoint",
  "csv": "https://cua.ai/benchmarks/fork-from-checkpoint.csv",
  "markdown": "https://cua.ai/benchmarks/fork-from-checkpoint.md",
  "group": "Fork and snapshot",
  "current": {
    "run": "2026-10-25",
    "schema": "cua.bench-result/v1",
    "bench": "fork.qemu",
    "slug": "fork-from-checkpoint",
    "metric": "fork_to_first_exec_ms",
    "value": 328.8,
    "unit": "ms",
    "stat": "p50",
    "n": 30,
    "percentiles": {
      "p50": 328.8,
      "p90": 411.8,
      "p95": 422.6,
      "p99": 447.9,
      "min": 225.5,
      "max": 447.9
    },
    "extra": {
      "fork_many16_wall_ms_p50": 2768.4,
      "fork_many16_ready_p50_ms_median": 2049,
      "fork_many16_batches": 10,
      "fork_many16_failed": 0
    },
    "samples_csv": "samples.csv",
    "measured_at": "2026-10-25T01:16:30Z",
    "build": {
      "cua": "0.9.0",
      "cua_spacesd": "0.8.0",
      "app": "0.15.0",
      "source": "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",
      "published": true,
      "harness": "built from tag cua-spaces-v0.15.0 (709b18d9ee) on the host: cargo build --release -p cua-sdk --example rollout_bench --example channel_bench (Rust 1.97.1)"
    },
    "host": {
      "name": "Mac Studio",
      "model": "Mac14,13 (Mac Studio)",
      "chip": "Apple M2 Max",
      "cpus": 12,
      "memory_gb": 96,
      "os": "macOS 26.6.2 (25G83)",
      "where": "local"
    },
    "environment": {
      "load_avg_before": [
        1.35,
        3.21,
        7.88
      ],
      "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"
    },
    "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).",
    "reproduce": "# On an Apple silicon Mac (macOS 26), with Rust (rustup) and git:\ncurl -fLO https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg\nhdiutil attach -nobrowse -mountpoint /tmp/cua-dmg cua-spaces-0.15.0-darwin-universal.dmg\nmkdir -p ~/bench && ditto \"/tmp/cua-dmg/Cua Spaces.app\" ~/bench/\"Cua Spaces.app\" && hdiutil detach /tmp/cua-dmg\ngit clone --depth 1 --branch cua-spaces-v0.15.0 https://github.com/trycua/cua ~/bench/cua\n(cd ~/bench/cua/libs/cua && cargo build --locked --release -p cua-sdk --example rollout_bench --example channel_bench)\nexport PATH=\"$HOME/bench/Cua Spaces.app/Contents/MacOS:$PATH\" CUA_HOME=~/bench/home DO_NOT_TRACK=1 CUA_TELEMETRY=0\nRB=~/bench/cua/libs/cua/target/release/examples/rollout_bench\ncua daemon start --foreground &\n$RB create --prefix fsrc- --n 1 --kind vm --cpus 2 --memory-mb 2048 --headless --forkable --keep\ncua 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'\n$RB checkpoint --source fsrc-0 --name ckq-1 --pin\n$RB fork --source ckq-1 --prefix fq- --n 30 --conc 1                    # serial forks, each deleted after its sample\nfor 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",
    "caveats": [
      "QEMU VM kind. A gVisor fork from a checkpoint, n = 10, took p50 301 ms and p95 1,939 ms."
    ],
    "sources": [],
    "status": "measured"
  },
  "earlier": []
}
