HullPerformance
Performance

p99 48.5 ms.
Now 5.6.

12 scenes from the engine's own examples, run offscreen at full speed and read over the control port once a second, plus headless benches for each system. The first run found a crash, a stall and a wasted filter pass. Below: the numbers after the fixes, against the baseline.

1920×1080 offscreen, vsync off, dev profile (opt-level 3 + debuginfo), M-series MacBook Pro with 15 cores, 20 s window after an 8 s warm-up

Flying over the open_world example: green valleys with pine forests, a village of small houses and a tower, snowy peaks on the horizon
open_world --pose fly: 4 × 4 km of terrain, 34,835 entities, p99 5.6 msexamples/open_world.rs
Scene benchmarks

12 scenes, after the fixes

Each scene launches its example with --offscreen --uncapped --play --mute --seed 1, waits 8 s, then samples metrics.dump every second for 20 s. Frame p50, p95 and p99 cover the last ~600 frames. GPU ms is this process's GPU busy time per frame; memory is the process footprint, Metal included.

Commit c8532d9, frame times on a quiet machine (load under 7.5); Mem MB for look_high, look_dusk and look_ultra from 617d3e5, after the offscreen frame-pacing fix (memory does not depend on load: three runs agreed within 5 %). Baseline: commit 2327039
Scenefpsp50 msp95p99GPU msMem MBEntitiesvs baseline
look_lowLighting, Low tier2294.34.85.13.8819797fps +19%, p95 −6%
look_highLighting, High tier1307.210.411.87.51,015799fps +31%, p95 −19%
look_duskLow sun, volumetrics, grading1277.511.212.47.61,050799fps +34%, p95 −17%
look_ultraSSR, realtime probe every frame6515.416.817.414.91,437799baseline crashed at start
open_world4 × 4 km terrain, 100k scatter, flying2384.14.75.63.71,10234,835fps +105%, p95 −50%
render_budget4,000-prop town3283.03.63.92.86785,005fps +32%, p95 −10%
ai_crowd200 agents: navmesh, crowds, trees, perception3282.93.23.42.67101,161fps +12%, p95 −37%
anim_demoState machines, IK, LOD3183.14.04.83.0756937fps +3%, p95 −13%
vfx_galleryEvery particle preset2883.43.84.02.9728759fps +55%, p95 −40%
vfx_stress100k CPU particles2623.74.34.73.1805727fps +55%, p95 −33%
sound_demoMixer, 3D voices, occlusion, music3682.73.23.92.5634738fps +70%, p95 −14%
ui_galleryUI kit screens3183.03.43.72.8698740fps +5%, p95 −13%

Scenes the fixes did not touch (render budget, VFX, UI) also got faster, which suggests the baseline machine was not fully idle; the look and open world gains are the fixes. The suite records the machine load for every scene and warns when one ran on a busy machine.

Found by the benchmarks

What the first run caught

  1. 1
    Crash

    look_ultra crashed at start, and leaving Ultra crashed

    Cause SSR switches materials to deferred by touching them with Assets::get_mut, which in Bevy 0.19 is not a change unless written through, and probe capture views had no deferred prepass.

    Fix Materials are marked changed and side views get a deferred prepass while SSR is on. Every tier switch works.

    look_ultra fps
    from Crashed to 65
  2. 2
    Stall

    open_world stalled 10.5 s after loading, then hitched every second while flying

    Cause The AI plugin triangulated every streamed terrain collider on the main thread and re-baked navmesh tiles, in a demo with no agents.

    Fix Navmesh work starts only when a NavAgent or NavSource exists. 36 hitches per run became 7, with no stall.

    open_world p99 ms
    from 48.5 to 5.6 −88%
    open_world fps
    from 116 to 238 +105%
  3. 3
    Probe

    High and dusk spent their frame on the reflection probe

    Cause The realtime reflection probe ran Bevy’s environment-map filter every frame, re-creating bind groups and buffers each time.

    Fix The filter runs once per full cycle of fresh faces: about 100 filters per second became about 28.

    look_high fps
    from 99 to 130 +31%
    look_dusk fps
    from 95 to 127 +34%
  4. 4
    Memory

    High, dusk and Ultra used four to five times the memory of Low

    Cause Offscreen runs had no frame pacing. With no swapchain, nothing made the CPU wait for the GPU, so in GPU-bound scenes frames queued without limit and the Metal driver held tens of thousands of command buffers. wgpu itself held about 200 buffers, which ruled out a leak in the engine.

    Fix Offscreen rendering now waits like a swapchain, with at most two frames in flight. Frame time is unchanged when the GPU keeps up.

    look_high Mem MB
    from 3,933 to 1,015 −74%
    look_dusk Mem MB
    from 4,097 to 1,050 −74%
  5. 5
    Misleading

    Render budget spans read 1 to 3 ms per frame

    Cause The span’s wall-time window took in Bevy’s visibility systems.

    Fix Spans removed; render.cpu_us is the real cost, 0.3 ms in open_world.

Headless CPU benches

Systems without a window

The #[ignore] bench tests time each system on its own, with no rendering. No bench code changed between the two columns, so most of the difference is the baseline machine’s load.

BenchBaseline, 2327039After, c8532d9
Anim crowd, 500 characters2.5 ms per frame (1.8 with LOD)1.7 ms (1.3 with LOD)
Navmesh bake, 300 × 300 m, 600 crates109 ms wall, path query 0.13 ms89 ms wall, path 0.11 ms
Behaviour trees + perception, 500 agents0.06 + 1.0 ms per frame0.06 + 0.93 ms
Sound DSP, 48 voices, 6 buses, reverb1.0% of one core0.97%
Net server, 64 clients × 500 entities3.6 ms per frame (1.2 with relevancy)2.1 ms (1.2 with relevancy)
Save 10k entitieswrite 6.4 ms, read 3.2 mswrite 4.5 ms, read 2.3 ms
Inspector ecs.query, 10k entities to JSON35 ms (0.27 ms with limit 10)28 ms (0.14 ms)
Reproduce

Run it yourself

perf_suite.py run builds the examples once, runs every scene, writes one JSON report per scene under target-bench/ and compares with the previous run. It exits 1 when a key got worse by more than the threshold. bench.py run does the same for the headless benches.

The ai_crowd arena from above: walls, crates, a raised platform and a crowd of blue agents spread across the floor
ai_crowd: 200 agents at 328 fps, p95 3.2 msexamples/ai_crowd.rs
terminal
python3 -I scripts/perf_suite.py list      # the scenes
python3 -I scripts/perf_suite.py run       # all scenes, ~10 min; compares with the last run
python3 -I scripts/perf_suite.py run --scenes look_high,open_world --secs 30
python3 -I scripts/bench.py run --test anim   # headless CPU benches: ai, devkit, sound, net
python3 -I scripts/bench.py compare target-bench/<old> target-bench/<new>
Known limits

Not solved yet

  • A realtime reflection probe still costs more memory than a baked one (its six face targets): compare Mem MB for look_low with look_high. Bake probes when nothing in the room moves.
  • open_world had no long frames in the bench window. Over a longer flight a few long frames remain when new scatter streams in; scatter now spawns at most 1000 items per frame, but spawning still runs on the main thread.
  • This Mac is shared with other projects’ builds. The suite records the load for every scene; numbers from busy runs are not published here.
  • The numbers are a dev profile on one machine. Ship builds (release, no devtools) are faster.

Source: docs/PERF.md. Each system's own measurements are in its doc: LOOK, ANIM, VFX, AI, SOUND, WORLD, NET.