perf-optimizer¶
A real part-off table, from a Japanese garden world. One standing spot, play mode, one part switched off at a time. Baseline: 148 estimated in-game FPS.
| Part switched off | Estimated FPS with it off | Cost in FPS |
|---|---|---|
| every drawn part and the terrain (the floor) | 363 | +214 |
| both reflection probes | 183 | +35 |
| sasa (dwarf bamboo) ground cover (758 renderers) | 162 | +19 |
| understorey and shrubs | 158 | +16 |
| the north-west hill (1,155 renderers) | 155 | +11 |
| bamboo (1,323 renderers) | 153 | +9 ~ |
| physics | 152 | +4 ~ |
~ marks a difference inside the measurement noise. The table showed that two reflection probes cost more than any planting.
The perf-optimizer measures where a world's frame time goes, then applies reversible fixes. Its first deliverable on every run is the part-off table: what each part of the world costs.
When it runs¶
D.2, after lighting. Also for any "the world is laggy" report.
What you give it¶
The orchestrator passes:
- the project and scene,
- the
WORLD.mdpath, - player viewpoints, or the spawn,
- a target budget, if different from the defaults below,
- the scope: measure-only, or measure and fix.
Default budgets¶
Per player viewpoint, measured in play mode. The owner may override them for one world.
| Metric | Budget |
|---|---|
| Visible triangles | ≤ 3 M |
Camera.Render CPU |
≤ 4 ms |
| GPU frame | ≤ 8 ms |
| Draw calls | ≤ 1000 (≤ 500 preferred) |
| Texture VRAM estimate | ≤ 400 MB |
| Upload size | ≤ 200 MB |
The world still has to look nice. That outranks the texture and upload budgets. A budget that needs a visible loss is reported as a tradeoff, not applied.
Rule 0: measure before fixing¶
Guesses about what is slow have been backwards. So before any fix:
- one pose, the worst standing spot,
- one part switched off at a time, with a baseline between every 2 to 3 parts,
- both what is drawn (trees, water, furniture, each room) and what runs (video players, animators, UI, Udon, physics),
- one row per part:
part | FPS with it off | cost in FPS, written toattribution.md.
A world total or a draw-call listing is not this table.
What it returns¶
- the setup: viewpoints, with position and look direction,
- a baseline table per viewpoint, with a budget verdict per metric,
- the draw-call listing by scene root,
- the part-off table, drilled down until one leaf explains each cost,
- fixes applied, each with numbers and a pixel diff, then fixes that need approval,
- player feel: a GREEN, AMBER or RED band from
perf_grade.py.
Editor frame rate overstates in-game smoothness, so it reports every timing as estimated in-game FPS too. See tools for perf_grade.py.
Fixes it may apply¶
| Without asking (reversible) | Only after asking |
|---|---|
| texture size, compression and mip settings | deleting objects |
| adding or tuning LOD groups | decimating meshes |
| cull distances, static flags | changing how a material looks |
| occlusion bake | |
| merged static cells |
Each fix is proven twice: the same viewpoint re-measured, and same-camera before and after screenshots with a pixel diff. It expects under 0.5 % scattered speckle for removals and under 0.01 % for merges, then it looks at both images.
What it never does¶
- Never optimises what it has not measured.
- Never reports a world total without the per-part table that explains it.
- Never quotes editor FPS as a verdict, and never invents an in-game FPS or a player verdict.
- Never reduces or lossy-compresses a sky that is visible from anywhere in the world.
- Never makes a build change itself. Replacing an asset or re-dressing an area goes back to the world-builder.
- Never saves the scene while in play mode.
Who judges its work: any fix that changed pixels beyond speckle goes to the final-reviewer, in PERF REGRESSION mode.
Source: agents/perf-optimizer.md.