[PR #3017] [MERGED] perf(assets): drop the spare capacity of the sprite pixel buffer #4755

Closed
opened 2026-11-03 05:07:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3017
Author: @DanielGodriNeto
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @rdbtCVS

Base: main ← Head: perf/sprite-pixels-shrink


📝 Commits (1)

  • 9042746 perf(assets): drop the spare capacity of the sprite pixel buffer

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/assets.rs (+2 -0)

📄 Description

🤖 Opened by Daniel's AI agent (Claude Code), not by Daniel himself.

What

Sprites::finish grows the pixel buffer by doubling, so after loading it keeps spare capacity that is never used again. RenderAssets::load now calls shrink_to_fit() on it right after finish(). Two lines, no behaviour change.

Evidence

Measured in two rounds on a 647 MB resource set: RenderAssets 67 -> 55 MB, loader peak about 239 -> 227 MB (-5%). Load time was not A/B'd on a noisy machine; the worst case is one copy of a ~21 MB buffer. Memory only, no FPS claim.

Note

Touches the same lines of assets.rs as #3015 (sprite disk cache); whichever merges second needs a trivial rebase.

pr_ready

pr_ready.py --quick --base upstream/main on Windows: scope (1 file, +2), public tree, rustfmt, clippy, doc tests pass. The same 2 horizon-client tests (crash::tests::stacks_start_at_the_panicking_frame, save::tests::session_lock_is_exclusive) and some Python tests fail as before, none in code this PR touches.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3017 **Author:** [@DanielGodriNeto](https://github.com/DanielGodriNeto) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `perf/sprite-pixels-shrink` --- ### 📝 Commits (1) - [`9042746`](https://github.com/horizon-rust/horizon/commit/9042746704f71fbdcb10ee11c1f3fa98de78226e) perf(assets): drop the spare capacity of the sprite pixel buffer ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/assets.rs` (+2 -0) </details> ### 📄 Description > 🤖 Opened by Daniel's AI agent (Claude Code), not by Daniel himself. ## What `Sprites::finish` grows the pixel buffer by doubling, so after loading it keeps spare capacity that is never used again. `RenderAssets::load` now calls `shrink_to_fit()` on it right after `finish()`. Two lines, no behaviour change. ## Evidence Measured in two rounds on a 647 MB resource set: `RenderAssets` 67 -> 55 MB, loader peak about 239 -> 227 MB (-5%). Load time was not A/B'd on a noisy machine; the worst case is one copy of a ~21 MB buffer. Memory only, no FPS claim. ## Note Touches the same lines of `assets.rs` as #3015 (sprite disk cache); whichever merges second needs a trivial rebase. ## pr_ready `pr_ready.py --quick --base upstream/main` on Windows: scope (1 file, +2), public tree, rustfmt, clippy, doc tests pass. The same 2 horizon-client tests (`crash::tests::stacks_start_at_the_panicking_frame`, `save::tests::session_lock_is_exclusive`) and some Python tests fail as before, none in code this PR touches. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:42 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4755
No description provided.