{
  "slug": "exec-latency",
  "question": "How long does a command round trip into a Space take?",
  "answer": "A command round trip (sh -c) into a running QEMU Linux VM Space took 0.878 ms (p50, n = 300) from the same Mac, over loopback, 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/exec-latency",
  "csv": "https://cua.ai/benchmarks/exec-latency.csv",
  "markdown": "https://cua.ai/benchmarks/exec-latency.md",
  "group": "Density and throughput",
  "current": {
    "run": "2026-10-25",
    "schema": "cua.bench-result/v1",
    "bench": "channel.qemu",
    "slug": "exec-latency",
    "metric": "exec_sh_ms",
    "value": 0.878,
    "unit": "ms",
    "stat": "p50",
    "n": 300,
    "percentiles": {
      "p50": 0.878,
      "p95": 0.961,
      "p99": 1.022,
      "max": 1.06
    },
    "extra": {
      "exec_run_p50_ms": 0.818,
      "exec_run_p95_ms": 0.893,
      "rpc_health_p50_ms": 0.653,
      "rpc_health_p95_ms": 1.113
    },
    "samples_csv": "samples.csv",
    "measured_at": "2026-10-25T01:12:51Z",
    "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.32,
        4.84,
        9.88
      ],
      "other_vms": 1,
      "network": "n/a (local)",
      "kind": "vm",
      "image": "linux (catalog alias, full Linux VM disk)",
      "shape": "2 vCPU, 2 GiB"
    },
    "method": "Driver on the host: `bench/channel/run.sh` from tag cua-spaces-v0.15.0 with `channel_bench` (Rust SDK example built from the tag). It creates one Linux VM Space on this Mac (`cua spaces create linux --on local --kind vm --cpus 2 --memory-mb 2048`, QEMU on HVF), measures it through the SDK and deletes it. Route: `local 127.0.0.1` (gRPC to the Space's cua-spacesd). Exec: 300 serial round trips each of a no-op RPC, `true` run directly, and `sh -c` (5 warm-up calls excluded). Files: one file per transfer of 1 MiB (n=20), 4 MiB (20), 16 MiB (10), 100 MiB (10), 512 MiB (5), upload then download, MiB/s = size / p50 time; files of 2 MiB and more use the VM's bulk lane (a shared disk, SHA-256 checked). channel_bench writes percentiles per metric, not per sample, so samples.csv holds one row per metric.",
    "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 &\ncd ~/bench/cua/libs/cua\nCUA=cua BENCH=target/release/examples/channel_bench FILES=1:20,4:20,16:10,100:10,512:5 OUT=results \\\n  bash bench/channel/run.sh bench/channel/baselines/macos-m2max-qemu.json",
    "caveats": [
      "Same machine (loopback): a client on another machine adds its network round trip.",
      "samples.csv has one row per metric (percentiles), not one per sample."
    ],
    "sources": [],
    "status": "measured"
  },
  "earlier": []
}
