Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Performance

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.

~1,500 benchmarks across 76 sections Criterion.rs + Real Ollama validation Production Ready (Grade A+)
85% p99 headroom at 1,000 entities @ 60 FPS
15.0µs ECS entity spawn (100), 70% under target
286ns GOAP planning (full), 97% under target
9.8ns GOAP cache hit, 99% under target
1.27ms p50 frame time at 1,000 entities
2.42ms p99 frame time at 1,000 entities
Executive summary

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.

SystemBenchmarkTargetActualMargin
ECSEntity spawn (100)<50µs15.0µs70% under
ECSEntity spawn (1000)<500µs106.7µs79% under
AIGOAP planning (full)<10µs286ns97% under
AIGOAP planning (cache)<1µs9.8ns99% under
Framep50 @ 1k entities<16.67ms1.27ms92% under
Framep99 @ 1k entities<16.67ms2.42ms85% under
Best performers

Operations achieving sub-nanosecond and sub-10ns latency.

These benchmarks represent AstraWeave's highest-performing operations, many achieving sub-nanosecond latency.

Sub-nanosecond

Operations under 1 ns

OperationLatencyThroughput
Multi-Agent Per-Agent12-20 ps50-83 trillion/sec
Nav Sliver Triangles99-104 ps10 billion/sec
Multi-Agent Per-Plan0.29-0.31 ns3.2-3.4 billion/sec
Pan Mode Switching418 ps
State Transitions0.49-0.51 ns
Emotion Blending0.55 ns
Multi-Agent Feedback0.73-0.76 ns1.3 billion/sec
MSAA Resize 720p582-645 ps
UI Settings Nav696 ps
Clear Frame0.72 ns
Weather Attenuation730-783 ps22.8 billion/frame
Room Overlap Check571-629 ps
Frustum AABB Inside889-915 ps
GPU Budget Check890 ps-1.05 ns17 billion/frame
Sub-10 nanosecond

Operations under 10 ns

OperationLatencyNotes
SparseSet Lookup (1k)1.56 ns37× faster than BTreeMap
SIMD Movement1.73 ns2.26× faster than naive
Quat Multiply1.34 nsglam SIMD-optimized
Quat Slerp2.10 nsRotation interpolation
Context Switching2.38 ns7M switches/frame
GOAP (no enemies)3.46-3.56 nsIdle detection FREE
Component Deserialize3.50 nsPostcard ECS
Physics Stage3.63 ns7,580× vs perception
RAG Engine Creation4.61 nsZero-cost abstraction
Mat4 Multiply4.28 nsglam SIMD matrix
GOAP (close)4.68-5.11 nsTactical decision
GOAP (far)7.04-7.86 nsStrategic decision
SparseSet Insert9.9 ns13× faster than BTreeMap
Core systems

Engine subsystem benchmarks

Each subsystem is benchmarked independently with Criterion.rs. Results include budget analysis against the 16.67ms frame budget.

ECS

Entity-Component-System

BenchmarkResultBudget
Spawn empty (10k)645µsExcellent
Spawn + Position (10k)5.6msProduction
Despawn empty (10k)287µsFixed
Despawn + comp (10k)2.5ms68% faster
Iteration (10k)273µsExcellent
Archetype trans (10k)5.6msWithin budget
AI

Planning and orchestration

BenchmarkResultNotes
GOAP (cache hit)9.8 ns99% under
GOAP (cache miss)286 ns97% under
GOAP next (idle)3.5 ns4.7B ops/frame
GOAP next (close)5.1 ns3.5B ops/frame
GOAP next (far)7.9 ns2.4B ops/frame
Multi-agent (10)1.34-1.39µs66-68% faster
Arbiter GOAP101.7 ns982× faster
Arbiter LLM575 ns86× faster
Mode transition221.9 ns45× faster
Physics

Simulation and collision

BenchmarkResultNotes
Character move43.8-52.0 ns12-26% faster
Rigid body lookup14.8-15.4 ns10× vs character
Raycast (empty)26.3-31.5 ns8-23% faster
Rigid body batch47µsExcellent
Spatial hash99.96% fewerGrid optimization
Fluids

SPH simulation (A+ grade)

BenchmarkResultNotes
Particles (1K-10K)5.3-110µs100-322 Melem/s
Spatial hashing163µs-5.6ms38-62% improved
SPH kernels (100K)171-223µspoly6/spiky
Density/pressure3.5-10.5ms
Sim step (1K)1.8-3.0ms
Multi-step450-500µs45-57% faster
GPU data prep0.9-2.6 nsSub-nanosecond
Rendering

wgpu pipeline benchmarks

CategoryBenchmarkResult
CullingAABB inside889-915 ps
CullingContains point951 ps-1.01 ns
MSAAMode check795-842 ps
MSAAResize 720p582-645 ps
CameraView matrix4.42-5.36 ns
CameraToggle mode1.72-2.29 ns
InstancingSavings calc1.43-1.52 ns
WeatherParticle1.95-2.04 ns
WeatherAttenuation730-783 ps
Animation and navigation

Interpolation and pathfinding

BenchmarkResultNotes
vec3_lerp1.69-1.83 ns57% faster
quat_to_rotation1.63-1.73 ns36% faster
Tween update22.1 ns
Spring update14.2 ns1.6× vs tween
Sliver triangles99-104 psSub-nanosecond
Impossible paths3.7-24.9µsFast-fail
Maze stress1.6-108µs
Pathfind short7.5µsExcellent
Frame budget analysis

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.

Budget breakdown (1,000 entities)
SystemTimeBudget %Status
ECS Core85 µs0.51%
AI (500 agents)471 µs2.83%
Physics (100 bodies)47 µs0.28%
Core loop (5k)529 µs3.17%
p50 Total1.27 ms7.6%
p99 Total2.42 ms14.5%
Headroom14.25 ms85%
Scalability projections
Entity Countp99 EstimateFeasibility
1,0002.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
60 FPS capacity

ECS time at scale

Entity CountECS TimeBudget Used
1,000~85µs0.51%
5,000~529µs3.17%
10,000~1ms~6%
Reproduce locally

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
Philosophy

Benchmarks as verification artifacts, not marketing numbers.

Reproducibility Every claimed measurement has a command that reproduces it.
Raw logs All runs capture raw output for auditing.
Statistical rigor Criterion.rs provides confidence intervals.
Adversarial testing 22 adversarial benchmark sections stress edge cases.
Real hardware No synthetic workloads — real game scenarios.
Further reading

See also