[PR #7498] [MERGED] Draw framed maps without formatting or copying per map per frame #7627

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7498
Author: @ludovic111
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: perf/map-frame-names


📝 Commits (1)

  • eb2b96b Draw framed maps without formatting or copying per map per frame

📊 Changes

2 files changed (+13 additions, -10 deletions)

View changed files

📝 crates/horizon-client-render/src/hud.rs (+9 -1)
📝 crates/horizon-client/src/game/maps.rs (+4 -9)

📄 Description

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

Every framed or held map asked the HUD atlas for its slot with format!("horizon/map{slot}") and cloned the map's decoration list, each frame. A wall of maps paid one String and one Vec copy per map per frame.

  • hud::map_slot_sprite(slot) names the 256 slots once (also used when the atlas reserves them).
  • map_vertices borrows the decorations instead of cloning them.

Same sprites, same decorations, same order: no visible change. Not measured in fps (no map-wall stress scene yet); it removes two allocations per drawn map per frame.

pr_ready (tools/pr_ready.py --quick on playhorizon, against origin/main at 68ff46998, 12 min 59 s)

Check Result
Scope ✅ 2 files, +13 −10
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (1 min 3 s)
rustfmt ✅ (14 s)
clippy ✅ (3 min 23 s)
tests: horizon-client, horizon-client-render ✅ 1890 passed (7 min 9 s)
doc tests ✅ 0 passed (6 s)
content root tests ➖ content root untouched
mod API up to date ✅ (44 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 140 affected, to run in CI (--quick): ambient_sound, anvil_turtle_egg, armor_stand_frost, armor_stand_turtle_egg, arrow, arrow_wind_charge, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles and 128 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/7498 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/map-frame-names` --- ### 📝 Commits (1) - [`eb2b96b`](https://github.com/horizon-rust/horizon/commit/eb2b96b6b2551be8494f0ef34189175c4c0e1685) Draw framed maps without formatting or copying per map per frame ### 📊 Changes **2 files changed** (+13 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/hud.rs` (+9 -1) 📝 `crates/horizon-client/src/game/maps.rs` (+4 -9) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Every framed or held map asked the HUD atlas for its slot with `format!("horizon/map{slot}")` and cloned the map's decoration list, each frame. A wall of maps paid one `String` and one `Vec` copy per map per frame. - `hud::map_slot_sprite(slot)` names the 256 slots once (also used when the atlas reserves them). - `map_vertices` borrows the decorations instead of cloning them. Same sprites, same decorations, same order: no visible change. Not measured in fps (no map-wall stress scene yet); it removes two allocations per drawn map per frame. **pr_ready** (`tools/pr_ready.py --quick` on playhorizon, against origin/main at 68ff46998, 12 min 59 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +13 −10 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (1 min 3 s) | | rustfmt | ✅ (14 s) | | clippy | ✅ (3 min 23 s) | | tests: horizon-client, horizon-client-render | ✅ 1890 passed (7 min 9 s) | | doc tests | ✅ 0 passed (6 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (44 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 140 affected, to run in CI (--quick): ambient_sound, anvil_turtle_egg, armor_stand_frost, armor_stand_turtle_egg, arrow, arrow_wind_charge, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles and 128 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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 07:21:05 +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#7627
No description provided.