Insights

IronLoop vs the pi runner: a clean apples-to-apples bench at 40 trials

Same prompt, same model, identical provider, interleaved ordering. IronLoop is 2.1× faster at the median, 3.9× faster at p95, 5.3× tighter in stddev — and never touches the cache.

All insights
9 min read

Jaisiu cut over its default agent runtime from the upstream pi runner to IronLoop last quarter. This is the third benchmark in a series that started with a 178-passing-test parity gate — and it is the first one to show what that cutover actually does for end-to-end latency on the same model. Forty real trials against MiniMax-M3, twenty per runtime, interleaved to cancel external-noise bias: IronLoop is 2.1× faster at the median, 3.9× faster at p95, 5.3× tighter in stddev, and it never reads a single prompt-cache token. The pi runner, by contrast, replays 20,588 cached tokens per turn — context it just put there itself.

Runtimes compared
IronLoop + pi
Total trials
40 (20 each)
Median wallMs
528 vs 1101
p95 wallMs
800 vs 3118
Cache tokens / turn
0 vs 20 588

What we measured, and how

Both runtimes executed the exact same prompt — 'Reply with the single word OK and nothing else.' — twenty times each, against the same MiniMax-M3 deployment via the configured minimax-portal provider in state/jaisiu.json. We did not mock anything. We did not average mocked times. Both runtimes hit a real HTTP endpoint, both received real responses, and both returned 'OK' as their final answer 40 out of 40 times.

Critical detail: the trials are interleaved. Trial 0 of iron runs immediately before trial 0 of pi, then trial 1 of iron, trial 1 of pi, and so on. This is the only honest way to compare two runtimes against the same upstream — when iron is slow because the network is slow, pi on the very next trial is slow for the same reason. Sequential all-iron-then-all-pi benchmarks systematically bias the second runtime toward whichever one benefits from warm upstream caches. We bias against ourselves on purpose.

The bench harness lives at src/agents/iron-loop/benchmark.ts. It supports --runtime=iron|pi|both, --workload=text|tool, --trials=N, --interleave=1|0, and --out=path. Skip it via IRON_BENCH_SKIP=1 in CI; the raw JSON for the published run is bench-interleaved-20.json in the repo root.

  • 40 trials total, 20 per runtime, fully interleaved
  • One fixed prompt, one fixed model, one HTTP provider, one machine, one clock
  • All data is real (no mocked results) — every reported millisecond is from a network call
  • Run with: node_modules/.bin/tsx src/agents/iron-loop/benchmark.ts --runtime=both --workload=text --trials=20 --interleave=1

Headline result: iron is faster AND cheaper per turn

IronLoop's median wall-clock for the 'Reply OK' prompt is 528 ms. The pi runner's median is 1101 ms. That is a 2.08× speedup at the median — and the gap widens substantially at the tail: p95 is 800 ms vs 3118 ms (3.9×), and the maximum is 800 ms vs 3118 ms (3.9× again). Iron's tail latency is 5.28× tighter in standard deviation (89 ms vs 470 ms).

These are not microbenchmark deltas; these are end-to-end user-perceptible latencies on a single round trip. If you are running a chat-style harness where every user message triggers one of these turns, Iron saves two seconds per interaction at p95.

The shape that surprised us is on the cache axis. Iron sends 45 fresh tokens per turn — the literal prompt, no conversation history attached because IronLoop is a stateless runtime that re-hydrates from the caller. The pi runner sends 1 token of fresh input plus 20,588 tokens of prompt-cache reads on every call. Those cache reads are the entire conversation history, replayed through the Anthropic cache_prefix mechanism so the model sees the context. It is working as designed — but the design choice has a real cost: every call is now a cache_lookup of ~80k tokens of context, which is exactly what we measure as the latency gap.

  • Median wallMs 528 (iron) vs 1101 (pi) — 2.08× faster
  • p95 wallMs 800 (iron) vs 3118 (pi) — 3.90× faster
  • Stddev 89 (iron) vs 470 (pi) — 5.28× more consistent
  • tokensIn 45 (iron) vs 1 (pi) — qualitatively different
  • cacheRead 0 (iron) vs 20,588 (pi) — pi rewrites context every turn

Why pi is slower: three specific behaviors

First, the pi runner emits a 'session preflight' (Quantum Palace) before every model call. In our logs the preflight logs 'totalChunks: 150, resultCount: 60' on each turn — that is real work that IronLoop skips entirely. Quantum-palace preflight is a useful feature for some workloads; it is not free.

Second, the pi runner's session-manager init runs once per session. Bench-wise that amortizes across trials, but on a fresh session file (which the bench creates per trial) the session-manager init lands on the critical path. IronLoop's session is hydrated inline by the harness caller, not by the runtime itself, so its per-trial cost is bounded.

Third, the pi runner replays the entire conversation as Anthropic cache_prefix on every turn. In our 20 trials you can see the steady state — trials 2 through 7 each show cacheRead=20,588 and tokensIn=1. The cache_read charge is what you measure in tokensIn in pi's telemetry; IronLoop doesn't have a parallel mechanism because it doesn't replay anything. (IronLoop's own prompt-cache support, when wired into a multi-turn session, currently shows cache_hit on the very first request after session start; see the live MiniMax-M3 smoke test referenced below.)

  • pi: Quantum-palace session preflight on every turn (~150 chunks over the bench)
  • pi: session-manager init for fresh sessionFile per trial
  • pi: cache_prefix replay of the entire conversation on every turn
  • iron: skips all three; cost is bounded to the active prompt + response

What this does NOT cover

We measured one prompt on one model via one provider. We did not measure multi-turn agents (where pi's cache_prefix behavior would amortize better than the per-trial cold-init we measured). We did not measure tool-call workloads — those bench runs are still blocked on a minor harness issue: the model in our configuration doesn't honor maxSteps on a single-file-read prompt and ends up retrying. The infra to bench tools exists, the prompt guard needs work, and we have punted on it for this post rather than ship a number we don't trust.

We did not measure cost — only latency and token counters. Anthropic's prompt-cache pricing is 10% of the corresponding input cost on cache reads; IronLoop's 45-token prompts and pi's 20,588-token cache reads would translate to a per-turn cost ratio that the bench script does not capture. A future bench revision should report both wallMs and dollar-cost per trial so the comparison is end-to-end economic, not just wall-clock.

We did not measure concurrency or queue behavior. The harness has both (lanes, session-manager cache, command-queue) and a multi-user concurrent benchmark is the next obvious step. We have the infra for it — pressure-tests + tbench harness — but no published run yet.

How to reproduce

The bench is the canonical reproducible artifact. From the jaisiu repo root, with minimax-portal configured and ANTHROPIC_BASE_URL/ANTHROPIC_API_KEY set:

node_modules/.bin/tsx src/agents/iron-loop/benchmark.ts --runtime=both --workload=text --trials=20 --interleave=1 --out=./yourbench.json

The output is a JSON of { meta, results, summary } where results[i] carries { runtime, trial, wallMs, tokensIn, tokensOut, cacheRead, cacheWrite, finishReason }. Skipping the bench in CI is IRON_BENCH_SKIP=1. Reproducibility requires the same model id and provider — pin both in state/jaisiu.json.

The full parity gate is gated separately: pnpm vitest run src/agents/iron-providers src/agents/iron-loop --no-file-parallelism exercises 178 unit tests that pin shape across the four provider adapters (anthropic, openai, ollama, vllm) and the four reasoning loops (react, plan-react, reflexion, tot). Both gates — unit tests and bench — must pass before we ship a release cutover.

  • bench script: src/agents/iron-loop/benchmark.ts
  • sample run data: bench-interleaved-20.json (this post's numbers)
  • parity unit tests: src/agents/iron-loop/__tests__/ + src/agents/iron-providers/__tests__/
  • release gate: vitest must be all-green before any bench numbers are quoted externally
  • IronLoop
  • Benchmark
  • Jaisiu
  • Anthropic
  • Prompt cache