{
  "slug": "spaces-vs-modal-start",
  "question": "Does a Cua Space start faster than a Modal Sandbox?",
  "answer": "On 2026-10-25: a Cua Space running on a Mac Studio ran its first command 234.6 ms after create; a Modal Sandbox, created from a different Mac over the internet with Modal's official Python SDK 1.6.2, took 690.7 ms (p50; n = 30 and 30). The two sides used different machines and network paths.",
  "status": "measured",
  "url": "https://cua.ai/benchmarks/spaces-vs-modal-start",
  "csv": "https://cua.ai/benchmarks/spaces-vs-modal-start.csv",
  "markdown": "https://cua.ai/benchmarks/spaces-vs-modal-start.md",
  "group": "Start",
  "series": [
    {
      "label": "Cua Spaces (This Mac)",
      "run": {
        "run": "2026-10-25",
        "schema": "cua.bench-result/v1",
        "bench": "spaces-startup.gvisor",
        "slug": "spaces-cold-start",
        "metric": "create_to_first_exec_ms",
        "value": 234.6,
        "unit": "ms",
        "stat": "p50",
        "n": 30,
        "percentiles": {
          "p50": 234.6,
          "p90": 257.7,
          "p95": 258.5,
          "p99": 270.1,
          "min": 204.8,
          "max": 270.1
        },
        "extra": {
          "first_create_ms": 13014.3,
          "failed": 0
        },
        "samples_csv": "samples.csv",
        "measured_at": "2026-10-25T00:44:00Z",
        "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": {
          "kind": "gvisor",
          "image": "ghcr.io/trycua/linux:24.04-slim",
          "shape": "1 vCPU, 1 GiB, --headless",
          "load_avg_before": [
            1.49,
            1.57,
            1.41
          ],
          "other_vms": 2,
          "network": "n/a (local)",
          "settings": "CUA_POOL_AUTO=off (no warm pool); golden snapshots at their default (on)"
        },
        "method": "Driver on the host: `rollout_bench create` (Rust SDK example built from the release tag) talks to this release's own `cua daemon` (isolated CUA_HOME). Workload: a gVisor container in the built-in Linux runtime VM (Lima on Virtualization.framework, default 4 vCPU / 32 GiB) Space created from ghcr.io/trycua/linux:24.04-slim with `--kind container --runtime gvisor --cpus 1 --memory-mb 1024 --headless` (only cua-spacesd in the guest, no desktop).\n\nEach sample = `SandboxCreateOptions` create call start → the Space's cua-spacesd answers a first `sh -c true` with exit 0 (create + attach + first exec). n=30, serial (one at a time), each Space deleted after its sample. The warm pool is off (`CUA_POOL_AUTO=off`), so every sample is a real create. One warm-up create before the samples is excluded (image pull/unpack and the golden snapshot it records: 13014 ms).",
        "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 &   # with CUA_POOL_AUTO=off in its environment\nIMG=ghcr.io/trycua/linux:24.04-slim\n$RB create --prefix warm- --n 1 --image $IMG --kind container --runtime gvisor --cpus 1 --memory-mb 1024 --headless   # excluded warm-up\n$RB create --prefix cold- --n 30 --conc 1 --image $IMG --kind container --runtime gvisor --cpus 1 --memory-mb 1024 --headless   # one JSON line per sample (ready_ms)",
        "caveats": [
          "Headless shape (only cua-spacesd); the full desktop image starts slower.",
          "Golden snapshots on (the default): the excluded first create records the snapshot that later creates restore.",
          "With CUA_GVISOR_WARM=0 (no golden snapshot), n = 10: p50 257.9 ms, p95 272.9 ms."
        ],
        "sources": [],
        "status": "measured"
      }
    },
    {
      "label": "Modal Sandboxes",
      "run": {
        "run": "2026-10-25/result-modal",
        "schema": "cua.bench-result/v1",
        "bench": "competitor.modal",
        "slug": "spaces-vs-modal-start",
        "metric": "create_to_first_exec_ms",
        "value": 690.7,
        "unit": "ms",
        "stat": "p50",
        "n": 30,
        "percentiles": {
          "p50": 690.7,
          "p90": 739.5,
          "p95": 776.2,
          "p99": 878.3,
          "min": 595.4,
          "max": 919.4
        },
        "extra": {
          "modal_create_return_ms_p50": 112.5,
          "modal_create_return_ms_p95": 152.6,
          "mean_ms": 686.6,
          "warmup_first_exec_ms": 1049.3,
          "ok": 30,
          "cost_usd_upper_bound": 0.02
        },
        "samples_csv": "samples-modal.csv",
        "measured_at": "2026-10-25T00:41:50Z",
        "build": {
          "source": "Modal cloud, official Modal Python SDK 1.6.2",
          "published": true,
          "modal_client": "1.6.2"
        },
        "host": {
          "name": "A second Mac (the client)",
          "where": "Modal cloud, client remote"
        },
        "environment": {
          "kind": "modal-sandbox",
          "image": "modal.Image.debian_slim() (cached after warmup)",
          "resources": "cpu=1.0, memory=1024 MiB, timeout=120 s",
          "network": "public internet client -> Modal API"
        },
        "method": "Serial, one at a time. t0 before modal.Sandbox.create(app, image=debian_slim, cpu=1, memory=1024); value = time until sb.exec('echo','ok') stdout is read back and the process has exited. create_ms = Sandbox.create returned. One warmup sample (image cache fill) excluded. Each sandbox terminated right after its sample; app stopped at the end.",
        "reproduce": "uv venv .venv && uv pip install --python .venv/bin/python modal==1.6.2\ncurl -fLO https://cua.ai/benchmarks/spaces-vs-modal-start/files/modal_start.py\nMODAL_ENVIRONMENT=<your environment> .venv/bin/python modal_start.py 30 debian_slim\nmodal app stop cua-bench --env <your environment> -y",
        "caveats": [
          "Measured from a different Mac than the Cua run, reaching Modal over the internet. No round-trip time was recorded.",
          "Create returns in about 0.1 s (mostly the API call); the first command includes the container start.",
          "Image: Modal's debian_slim, cached after one excluded warm-up; 1 CPU, 1024 MiB."
        ],
        "sources": [],
        "status": "measured"
      }
    }
  ]
}
