From 21e9dc1f3452825fde416a23a052c41badac31ee Mon Sep 17 00:00:00 2001 From: popertots Date: Fri, 20 Mar 2026 15:44:47 +0000 Subject: [PATCH] perf: double populate budget in release builds 512 chunks/frame in debug, 1024 in release. In release, recolor runs ~2x faster so 1024 still costs ~1ms but clears the dirty queue twice as fast, closing the p99 gap during rapid z-scrolling. --- src/world/tiles/tilemap_chunk.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/world/tiles/tilemap_chunk.rs b/src/world/tiles/tilemap_chunk.rs index b9ce5a1..1140c26 100644 --- a/src/world/tiles/tilemap_chunk.rs +++ b/src/world/tiles/tilemap_chunk.rs @@ -57,7 +57,10 @@ impl Default for TilemapChunkSpawner { } } +#[cfg(debug_assertions)] pub const MAX_POPULATE_PER_FRAME: usize = 512; +#[cfg(not(debug_assertions))] +pub const MAX_POPULATE_PER_FRAME: usize = 1024; #[derive(Resource)] pub struct PreviousZIndex(pub i32);