From 9042746704f71fbdcb10ee11c1f3fa98de78226e Mon Sep 17 00:00:00 2001 From: DanielGodriNeto Date: Tue, 27 Oct 2026 20:39:24 -0300 Subject: [PATCH] perf(assets): drop the spare capacity of the sprite pixel buffer --- crates/horizon-client/src/assets.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/horizon-client/src/assets.rs b/crates/horizon-client/src/assets.rs index 99d169c93..63c237c9e 100644 --- a/crates/horizon-client/src/assets.rs +++ b/crates/horizon-client/src/assets.rs @@ -218,6 +218,8 @@ impl RenderAssets { sprites.insert(root, &format!("minecraft:block/destroy_stage_{stage}"))?; } sprites.finish(); + // `finish` grows the buffer by doubling: keep only the bytes in use. + sprites.pixels.shrink_to_fit(); Ok(Self { sprite_size: sprites.size, sprite_minimum_size: sprites.minimum_size,