- Cache active_chunks(): one allocation instead of 5 per tick - heat_transfer/gas_step/pressure_step: direct chunk array access (chunk.temps[idx], chunk.gas_*[idx], chunk.pressure[idx]) instead of grid.get_temp()/set_temp() (eliminates 5 chunk-lookups per cell) - In-place updated_this_tick reset via get_chunk_mut (no Cell copy, no mark_dirty) - light_step: gather sources first (one pass), skip if no sources, reduced radius (lava 25→12, fire 15→6), frequency 10→20 ticks - gas_step: skip chunks with no gas (gas_density all 0) - pressure_step: skip chunks with all atmospheric (128), add mark_dirty - pre_dirty: HashMap instead of Vec (O(1) lookup vs O(n) linear search) - Cross-chunk heat transfer: edge_temps pre-loaded before mutable borrow - Spread chunk save I/O: 1 chunk/tick instead of all every 60 ticks - All 185 tests + 14 scenarios pass - Benchmark: 82.7 FPS avg, p99 86ms (was 18 FPS, p99 442ms)
17 lines
362 B
JSON
17 lines
362 B
JSON
{
|
|
"mode": "graphics",
|
|
"ticks": 300,
|
|
"total_time_ms": 3627.1,
|
|
"avg_fps": 82.7,
|
|
"avg_frame_time_ms": 12.06,
|
|
"p99_frame_time_ms": 86.45,
|
|
"min_frame_time_ms": 7.25,
|
|
"subsystems": {
|
|
"ca_step_avg_us": 4927,
|
|
"ca_step_p99_us": 79708,
|
|
"ca_step_min_us": 698,
|
|
"render_avg_us": 4154,
|
|
"render_p99_us": 6411,
|
|
"render_min_us": 3798
|
|
}
|
|
} |