Benchmark Methodology

All benchmarks were run on a standard EC2 t3.medium instance (2 vCPU, 4GB RAM) with OpenClaw v1.5.2. Each test ran 100 iterations; results show median (P50) and P95 latencies. LLM calls used the provider's public API with US-East endpoints.

Your results will vary based on network proximity to the LLM provider, task complexity, and concurrent load. Use these as relative comparisons, not absolute targets.

Latency Benchmarks by Model

Simple Task (single LLM call, no tools)

ModelP50 latencyP95 latencyCost / 1K tasks
GPT-4o-mini0.9s2.1s$0.02
GPT-4o2.4s5.8s$0.50
Claude 3 Haiku0.8s1.9s$0.025
Claude 3.5 Sonnet2.1s4.7s$0.60
Llama 3 8B (Ollama)1.2s3.0s$0 (local)
Llama 3 70B (Ollama)8.5s18.2s$0 (local)

Complex Task (3 tool calls + reasoning)

ModelSequential P50Parallel P50Speedup
GPT-4o-mini8.2s3.9s2.1×
GPT-4o18.7s9.4s2.0×
Claude 3 Haiku7.4s3.5s2.1×
Llama 3 8B (Ollama)14.1s7.0s2.0×

Throughput Benchmarks

Concurrent task processing capacity with different max_workers settings on a t3.large (2 vCPU, 8GB RAM):

max_workersTasks / minuteCPU usageMemory
1 (default)615%180MB
42245%320MB
83872%510MB
164188%780MB

Diminishing returns appear above 8 workers — the bottleneck shifts from CPU to LLM API rate limits.

Impact of Response Caching

Benchmark: 1,000 tasks from a real-world FAQ-answering workload (typical 40% cache hit rate):

ConfigurationTotal timeTotal costAvg latency
No caching82 min$4.804.9s
In-memory cache (TTL 1h)51 min$2.883.1s
Redis cache (TTL 24h)49 min$2.762.9s
Semantic cache (threshold 0.92)44 min$2.162.6s

Semantic caching (matching similar but not identical queries) achieves the best results at 55% cost reduction. See Response Caching for setup.

Token Usage Benchmarks

Token costs are often more impactful than latency. Here's how different context management strategies compare:

StrategyTokens / taskCost / 1K tasksQuality impact
No optimization3,400$0.51Baseline
max_tokens: 20482,100$0.32Minimal
Context summarization1,800$0.27None (long sessions)
RAG (retrieve only relevant)1,200$0.18None or positive
All optimizations combined900$0.14Minimal

Run Your Own Benchmarks

OpenClaw includes a benchmark runner. Create a benchmark file:

# benchmark.yaml
name: "My Benchmark Suite"
tasks:
  - prompt: "Summarize the key benefits of Python decorators"
    expected_keywords: ["wrapper", "function", "decorator"]
  - prompt: "List 5 uses of Redis in production"
    expected_keywords: ["cache", "queue", "session"]
runs: 50
models: [gpt-4o-mini, claude-3-haiku]
compare_profiles: [dev, production]
openclaw benchmark run benchmark.yaml --output results.json
openclaw benchmark report results.json --format html

The HTML report shows latency histograms, cost breakdowns, and quality scores side by side.

Benchmark Methodology

Meaningful benchmarks measure what your production workload actually does, not what a synthetic test does. Before running any benchmark, define the specific question you're trying to answer: "How many tasks per minute can this agent process with this model?" or "What is the p95 latency for a typical file analysis task?" A well-defined question determines which metrics to collect, what workload to simulate, and what constitutes a satisfactory result. Tests without a specific question tend to produce data that looks impressive but doesn't guide actionable decisions.

Use production-representative inputs for your benchmark workload. Synthetic inputs (all the same length, all the same structure) produce misleading results because the model's behavior varies significantly with input characteristics. Sample a hundred representative tasks from your production logs and use those as your benchmark input corpus. This ensures your benchmark captures the real variance in your workload — some tasks will be fast, some slow, and the distribution will match what users actually experience.

Key Metrics to Track

Track throughput (tasks per minute), latency at p50/p95/p99 percentiles, token consumption per task, tool call count per task, and error rate. Don't optimize for just one metric — a configuration that maximizes throughput by reducing model quality is counterproductive. Track all metrics together and look for trade-off points: where does increasing max_tokens improve output quality without significantly hurting throughput? Where does adding another tool call improve results without meaningfully increasing latency? These trade-off insights guide configuration decisions grounded in data rather than intuition.

Run benchmarks in conditions that match production as closely as possible: same network environment, same hardware tier, same model, same time of day (API rate limits and response times can vary). A benchmark run on a developer's laptop at night produces different results than production traffic on cloud infrastructure during peak hours. Establish your benchmark environment as close to production as feasible and run all comparison tests in the same environment.

Interpreting Results

Statistical significance matters for benchmark results. A single run may show a 5% improvement that is pure measurement noise. Run each configuration at least 5 times and compare the distributions rather than individual runs. If the 95% confidence intervals of two configurations overlap, the difference is not statistically significant — you haven't demonstrated a real improvement. Report median and p95 latency rather than mean — outlier-heavy distributions make the mean misleading, while median and p95 tell you what typical and worst-case behavior look like.

Benchmark Tooling

Use openclaw bench --runs 10 --task-file benchmark-inputs.jsonl --output results.csv to run a standardized benchmark suite. The --runs flag controls how many times each input is evaluated — more runs increase statistical confidence but cost more. Export to CSV for analysis in a spreadsheet or import into a monitoring dashboard. Store benchmark results alongside your git commits to track performance over time and quickly identify the commit that caused a regression.