{
  "slug": "spaces-vs-e2b-cold-start",
  "question": "Does a Cua Space start faster than an E2B sandbox?",
  "answer": "On 2026-10-25, from the same Mac Studio and in the same minutes: a Cua Space running on the Mac ran its first command 234.6 ms after create, and an E2B sandbox reached over the internet 299 ms (p50; n = 30 and 30). The round trip to E2B's API was 14.5 ms minimum, 44.8 ms average.",
  "status": "measured",
  "url": "https://cua.ai/benchmarks/spaces-vs-e2b-cold-start",
  "csv": "https://cua.ai/benchmarks/spaces-vs-e2b-cold-start.csv",
  "markdown": "https://cua.ai/benchmarks/spaces-vs-e2b-cold-start.md",
  "group": "Start",
  "series": [
    {
      "label": "Cua Spaces (This Mac)",
      "run": {
        "run": "2026-10-25/result-cua",
        "schema": "cua.bench-result/v1",
        "bench": "spaces-startup.gvisor",
        "slug": "spaces-vs-e2b-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-cua.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).",
          "Golden snapshots on (the default): the excluded first create records the snapshot that later creates restore.",
          "Measured on the Mac itself: no network between the client and the Space."
        ],
        "sources": [],
        "status": "measured"
      }
    },
    {
      "label": "E2B",
      "run": {
        "run": "2026-10-25/result-e2b",
        "schema": "cua.bench-result/v1",
        "bench": "competitor.e2b",
        "slug": "spaces-vs-e2b-cold-start",
        "metric": "create_to_first_exec_ms",
        "value": 299,
        "unit": "ms",
        "stat": "p50",
        "n": 30,
        "percentiles": {
          "p50": 299,
          "p90": 417.2,
          "p95": 626.1,
          "p99": 877.8,
          "min": 195.5,
          "max": 877.8
        },
        "extra": {
          "create_ms_p50": 224.7,
          "first_exec_ms_p50": 73.2,
          "spend_usd_this_run": 0.0001
        },
        "samples_csv": "samples-e2b.csv",
        "measured_at": "2026-10-25T00:44:30Z",
        "build": {
          "source": "E2B cloud, official E2B Python SDK e2b 2.59.0",
          "published": true,
          "vendor": "E2B",
          "sdk": "e2b (Python) 2.59.0",
          "template": "default base template (rki5dems9wqfm4r03t7g), 2 vCPU / 512 MiB"
        },
        "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": "e2b-cloud",
          "image": "E2B default base template",
          "e2b_region": "GCP us-west1 (The Dalles, Oregon; ipinfo from inside a sandbox, 2026-10-25)",
          "network": "home internet from the Mac; ICMP RTT to api.e2b.app (34.102.227.47) min/avg/max 14.5/44.8/139.4 ms (10 pings, 2026-10-25 00:43 UTC)",
          "load_avg_before": [
            2.3,
            1.75,
            1.48
          ],
          "other_vms": 2
        },
        "method": "Driver on the Mac (same host, same minutes as the Cua run): `e2b_bench.py cold --n 30 --conc 1` with the official E2B Python SDK. Each sample = `AsyncSandbox.create()` start → `sandbox.commands.run(\"true\")` returns exit 0 (create + first exec), serial, each sandbox killed after its sample. Includes the internet round trips from the Mac to E2B (us-west1); Cua's numbers are on the same machine with no network hop, so this compares what a client on this Mac sees, not E2B's in-region create time. Run right after the Cua gVisor serial run, 2026-10-25 ~00:44 UTC.",
        "reproduce": "python3 -m venv e2b-venv && e2b-venv/bin/pip install e2b==2.59.0 httpx\ncurl -fLO https://cua.ai/benchmarks/spaces-vs-e2b-cold-start/files/e2b_bench.py\nexport E2B_API_KEY=...   # your key\ne2b-venv/bin/python e2b_bench.py cold --n 30 --conc 1 --label cold30",
        "caveats": [
          "Different network paths: E2B is reached over the internet from the Mac (E2B region GCP us-west1); the Cua Space runs on the Mac.",
          "E2B's base template is 2 vCPU and 512 MiB; the Cua Space is 1 vCPU and 1 GiB, headless.",
          "This is what a client on this Mac sees, not E2B's in-region create time."
        ],
        "sources": [],
        "status": "measured"
      }
    }
  ]
}
