Performance Benchmarks
All benchmarks executed via Criterion.rs statistical benchmarking. Results sourced from the Master Benchmark Report v5.55 (January 2026). Every measurement can be reproduced with documented commands.
Key validation results — January 2026
Engine has 85% headroom at p99 for 1,000 entities at 60 FPS. All core systems operate well under their per-frame budgets.
| System | Benchmark | Target | Actual | Margin |
|---|---|---|---|---|
| ECS | Entity spawn (100) | <50µs | 15.0µs | 70% under |
| ECS | Entity spawn (1000) | <500µs | 106.7µs | 79% under |
| AI | GOAP planning (full) | <10µs | 286ns | 97% under |
| AI | GOAP planning (cache) | <1µs | 9.8ns | 99% under |
| Frame | p50 @ 1k entities | <16.67ms | 1.27ms | 92% under |
| Frame | p99 @ 1k entities | <16.67ms | 2.42ms | 85% under |
Operations achieving sub-nanosecond and sub-10ns latency.
These benchmarks represent AstraWeave's highest-performing operations, many achieving sub-nanosecond latency.
Operations under 1 ns
| Operation | Latency | Throughput |
|---|---|---|
| Multi-Agent Per-Agent | 12-20 ps | 50-83 trillion/sec |
| Nav Sliver Triangles | 99-104 ps | 10 billion/sec |
| Multi-Agent Per-Plan | 0.29-0.31 ns | 3.2-3.4 billion/sec |
| Pan Mode Switching | 418 ps | — |
| State Transitions | 0.49-0.51 ns | — |
| Emotion Blending | 0.55 ns | — |
| Multi-Agent Feedback | 0.73-0.76 ns | 1.3 billion/sec |
| MSAA Resize 720p | 582-645 ps | — |
| UI Settings Nav | 696 ps | — |
| Clear Frame | 0.72 ns | — |
| Weather Attenuation | 730-783 ps | 22.8 billion/frame |
| Room Overlap Check | 571-629 ps | — |
| Frustum AABB Inside | 889-915 ps | — |
| GPU Budget Check | 890 ps-1.05 ns | 17 billion/frame |
Operations under 10 ns
| Operation | Latency | Notes |
|---|---|---|
| SparseSet Lookup (1k) | 1.56 ns | 37× faster than BTreeMap |
| SIMD Movement | 1.73 ns | 2.26× faster than naive |
| Quat Multiply | 1.34 ns | glam SIMD-optimized |
| Quat Slerp | 2.10 ns | Rotation interpolation |
| Context Switching | 2.38 ns | 7M switches/frame |
| GOAP (no enemies) | 3.46-3.56 ns | Idle detection FREE |
| Component Deserialize | 3.50 ns | Postcard ECS |
| Physics Stage | 3.63 ns | 7,580× vs perception |
| RAG Engine Creation | 4.61 ns | Zero-cost abstraction |
| Mat4 Multiply | 4.28 ns | glam SIMD matrix |
| GOAP (close) | 4.68-5.11 ns | Tactical decision |
| GOAP (far) | 7.04-7.86 ns | Strategic decision |
| SparseSet Insert | 9.9 ns | 13× faster than BTreeMap |
Engine subsystem benchmarks
Each subsystem is benchmarked independently with Criterion.rs. Results include budget analysis against the 16.67ms frame budget.
Entity-Component-System
| Benchmark | Result | Budget |
|---|---|---|
| Spawn empty (10k) | 645µs | Excellent |
| Spawn + Position (10k) | 5.6ms | Production |
| Despawn empty (10k) | 287µs | Fixed |
| Despawn + comp (10k) | 2.5ms | 68% faster |
| Iteration (10k) | 273µs | Excellent |
| Archetype trans (10k) | 5.6ms | Within budget |
Planning and orchestration
| Benchmark | Result | Notes |
|---|---|---|
| GOAP (cache hit) | 9.8 ns | 99% under |
| GOAP (cache miss) | 286 ns | 97% under |
| GOAP next (idle) | 3.5 ns | 4.7B ops/frame |
| GOAP next (close) | 5.1 ns | 3.5B ops/frame |
| GOAP next (far) | 7.9 ns | 2.4B ops/frame |
| Multi-agent (10) | 1.34-1.39µs | 66-68% faster |
| Arbiter GOAP | 101.7 ns | 982× faster |
| Arbiter LLM | 575 ns | 86× faster |
| Mode transition | 221.9 ns | 45× faster |
Simulation and collision
| Benchmark | Result | Notes |
|---|---|---|
| Character move | 43.8-52.0 ns | 12-26% faster |
| Rigid body lookup | 14.8-15.4 ns | 10× vs character |
| Raycast (empty) | 26.3-31.5 ns | 8-23% faster |
| Rigid body batch | 47µs | Excellent |
| Spatial hash | 99.96% fewer | Grid optimization |
SPH simulation (A+ grade)
| Benchmark | Result | Notes |
|---|---|---|
| Particles (1K-10K) | 5.3-110µs | 100-322 Melem/s |
| Spatial hashing | 163µs-5.6ms | 38-62% improved |
| SPH kernels (100K) | 171-223µs | poly6/spiky |
| Density/pressure | 3.5-10.5ms | — |
| Sim step (1K) | 1.8-3.0ms | — |
| Multi-step | 450-500µs | 45-57% faster |
| GPU data prep | 0.9-2.6 ns | Sub-nanosecond |
wgpu pipeline benchmarks
| Category | Benchmark | Result |
|---|---|---|
| Culling | AABB inside | 889-915 ps |
| Culling | Contains point | 951 ps-1.01 ns |
| MSAA | Mode check | 795-842 ps |
| MSAA | Resize 720p | 582-645 ps |
| Camera | View matrix | 4.42-5.36 ns |
| Camera | Toggle mode | 1.72-2.29 ns |
| Instancing | Savings calc | 1.43-1.52 ns |
| Weather | Particle | 1.95-2.04 ns |
| Weather | Attenuation | 730-783 ps |
Interpolation and pathfinding
| Benchmark | Result | Notes |
|---|---|---|
| vec3_lerp | 1.69-1.83 ns | 57% faster |
| quat_to_rotation | 1.63-1.73 ns | 36% faster |
| Tween update | 22.1 ns | — |
| Spring update | 14.2 ns | 1.6× vs tween |
| Sliver triangles | 99-104 ps | Sub-nanosecond |
| Impossible paths | 3.7-24.9µs | Fast-fail |
| Maze stress | 1.6-108µs | — |
| Pathfind short | 7.5µs | Excellent |
Target: 60 FPS = 16.67ms per frame
Budget breakdown at 1,000 entities shows the engine using only 14.5% of the available frame time at p99, leaving 85% headroom for gameplay logic and rendering.
| System | Time | Budget % | Status |
|---|---|---|---|
| ECS Core | 85 µs | 0.51% | ✅ |
| AI (500 agents) | 471 µs | 2.83% | ✅ |
| Physics (100 bodies) | 47 µs | 0.28% | ✅ |
| Core loop (5k) | 529 µs | 3.17% | ✅ |
| p50 Total | 1.27 ms | 7.6% | ✅ |
| p99 Total | 2.42 ms | 14.5% | ✅ |
| Headroom | 14.25 ms | 85% | ✅ |
| Entity Count | p99 Estimate | Feasibility |
|---|---|---|
| 1,000 | 2.42 ms | ✅ 85% headroom |
| 5,000 | ~8-10 ms | ✅ 40-50% headroom |
| 10,000 | ~15-18 ms | ⚠️ Near budget |
| 20,000+ | >30 ms | ❌ Requires 30 FPS |
ECS time at scale
| Entity Count | ECS Time | Budget Used |
|---|---|---|
| 1,000 | ~85µs | 0.51% |
| 5,000 | ~529µs | 3.17% |
| 10,000 | ~1ms | ~6% |
Running benchmarks
Every benchmark can be reproduced with a single command. Criterion.rs provides confidence intervals and statistical rigor.
Full suite
# Run all Criterion benchmarks
cargo bench --workspace
# Run with odyssey automation (captures logs)
./scripts/benchmark_odyssey.ps1 \
-OutDir benchmark_results/$(Get-Date -Format 'yyyy-MM-dd')
Per-crate benchmarks
# ECS benchmarks
cargo bench -p astraweave-ecs
# AI benchmarks
cargo bench -p astraweave-ai
# Physics benchmarks
cargo bench -p astraweave-physics
# Render benchmarks
cargo bench -p astraweave-render
Generating HTML reports
# Open Criterion HTML report
cargo bench -p astraweave-ecs -- --save-baseline main
# Reports at: target/criterion/*/report/index.html
Benchmarks as verification artifacts, not marketing numbers.
See also
- MethodologyHow benchmarks are measured
- Optimization guidePerformance improvement techniques
- Performance budgetsFrame budget allocation
- Master benchmark reportComplete raw data