[PR #4373] [MERGED] joining a world: the player model and command registries are read once, not at every join #5589

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4373
Author: @iLostName
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: join-stall-cheaper


📝 Commits (1)

  • 737d74f joining a world: the player model and command registries are read once, not at every join

📊 Changes

2 files changed (+96 additions, -25 deletions)

View changed files

📝 crates/horizon-client/src/game/chat.rs (+73 -23)
📝 crates/horizon-client/src/game/perspective.rs (+23 -2)

📄 Description

What and why

Each join parsed entity-models.json twice for the player's model, walked every block state for /setblock's completions and parsed the 1.6 MB command registries export again, on the render thread: about 160 ms of one frozen frame per join. None of them changes while the game runs, so each is now read once per resources root or block registry (the player model already while the world resources load), and the join itself takes about 20 ms.

Vanilla reference

None: client-side caching of data that doesn't change while the game runs; what is read is the same.

Self-check

pr_ready (tools/pr_ready.py --quick on PC-Lost, against origin/main at 0a341cc35, 5 min 10 s)

Check Result
Scope ✅ 2 files, +96 −25
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (1 min 18 s)
rustfmt ✅ (12 s)
clippy ✅ (55 s)
tests: horizon-client ❌ 731 passed, 1 failed (2 min 39 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The one failure under the horizon-client tests is title::tests::each_world_preset_writes_its_own_generator, which makes a folder named minecraft:normal that Windows refuses; this branch doesn't touch it. Parity is left to CI.


🔄 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/4373 **Author:** [@iLostName](https://github.com/iLostName) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `join-stall-cheaper` --- ### 📝 Commits (1) - [`737d74f`](https://github.com/horizon-rust/horizon/commit/737d74f592b50cb474539bba4ffb55639cded157) joining a world: the player model and command registries are read once, not at every join ### 📊 Changes **2 files changed** (+96 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/chat.rs` (+73 -23) 📝 `crates/horizon-client/src/game/perspective.rs` (+23 -2) </details> ### 📄 Description ## What and why Each join parsed `entity-models.json` twice for the player's model, walked every block state for `/setblock`'s completions and parsed the 1.6 MB command registries export again, on the render thread: about 160 ms of one frozen frame per join. None of them changes while the game runs, so each is now read once per resources root or block registry (the player model already while the world resources load), and the join itself takes about 20 ms. ## Vanilla reference None: client-side caching of data that doesn't change while the game runs; what is read is the same. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on PC-Lost, against origin/main at 0a341cc35, 5 min 10 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +96 −25 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (1 min 18 s) | | rustfmt | ✅ (12 s) | | clippy | ✅ (55 s) | | tests: horizon-client | ❌ 731 passed, 1 failed (2 min 39 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The one failure under the horizon-client tests is `title::tests::each_world_preset_writes_its_own_generator`, which makes a folder named `minecraft:normal` that Windows refuses; this branch doesn't touch it. Parity is left to CI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:36 +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#5589
No description provided.