[PR #6839] [MERGED] Launch into a world: start its data preload once the biomes are loaded (−185 ms to the first frame) #7131

Closed
opened 2026-11-03 06:34:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: perf/early-launch-preload


📝 Commits (1)

  • 06582ae Launch into a world: start its data preload once the biomes are loaded

📊 Changes

1 file changed (+20 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+20 -4)

📄 Description

Requested by Ransom

🤖 Opened by Vaspyyy's AI agent (Claude Code), not by Vaspyyy personally.

What and why

Fixes #6834.

On a launch that names a world, preload_launch_world reads the worldgen bundle and prepares the Overworld's decoration, and the server's world open waits for it. It needs only the block registry and the biomes, which are ready at ~160 ms. It was called after load_core returned (~400–430 ms), behind the block models and sprites and the block facts.

With the game's own resources, the preload now starts on core's biomes worker as soon as the biomes are read. CoreTables.biomes becomes the Arc the preload shares. With a resource pack the preload keeps its old place: a pack failure reloads core from the vanilla root, which is what the preload must read. The later call stays, and does nothing once the preload has started.

Starting earlier also lets the preload finish sync_data before serve() asks for it, so on its own it removes the duplicate read #6726 describes for launches that name a world. #6729 still covers opening a world from the world screens.

Timings

python3 tools/startup_trace.py --world T --seed 1234 --runs 2 --warm, release builds alternating, 6 runs each. Ryzen 7 5800X, RTX 3070, NVMe, Linux. Medians:

upstream/main 435730a40 this PR
world.first_frame 1053 ms 868 ms (−185)
world.view_full 1729 ms 1534 ms (−195)
title.shown 629 ms 614 ms

On top of #6729: world.first_frame 970 → 872 ms.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

none (startup ordering only)

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on PunyDev, against upstream/main at 435730a40, 1 min 58 s)

Check Result
Scope ✅ 1 files, +20 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 602 passed (48 s)
rustfmt ✅ (9 s)
clippy ✅ (30 s)
tests: horizon-client ✅ 598 passed (29 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): 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)

🤖 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/6839 **Author:** [@Vaspyyy](https://github.com/Vaspyyy) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/early-launch-preload` --- ### 📝 Commits (1) - [`06582ae`](https://github.com/horizon-rust/horizon/commit/06582aea2be856d8a9396d2090cb86b5173fc628) Launch into a world: start its data preload once the biomes are loaded ### 📊 Changes **1 file changed** (+20 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+20 -4) </details> ### 📄 Description <!-- claude-projects-attribution: {"github_login":"Vaspyyy"} --> _Requested by **Ransom**_ > 🤖 Opened by Vaspyyy's AI agent (Claude Code), not by Vaspyyy personally. ## What and why Fixes #6834. On a launch that names a world, `preload_launch_world` reads the worldgen bundle and prepares the Overworld's decoration, and the server's world open waits for it. It needs only the block registry and the biomes, which are ready at ~160 ms. It was called after `load_core` returned (~400–430 ms), behind the block models and sprites and the block facts. With the game's own resources, the preload now starts on core's biomes worker as soon as the biomes are read. `CoreTables.biomes` becomes the `Arc` the preload shares. With a resource pack the preload keeps its old place: a pack failure reloads core from the vanilla root, which is what the preload must read. The later call stays, and does nothing once the preload has started. Starting earlier also lets the preload finish `sync_data` before `serve()` asks for it, so on its own it removes the duplicate read #6726 describes for launches that name a world. #6729 still covers opening a world from the world screens. ### Timings `python3 tools/startup_trace.py --world T --seed 1234 --runs 2 --warm`, release builds alternating, 6 runs each. Ryzen 7 5800X, RTX 3070, NVMe, Linux. Medians: | | upstream/main 435730a40 | this PR | |---|---|---| | `world.first_frame` | 1053 ms | 868 ms (**−185**) | | `world.view_full` | 1729 ms | 1534 ms (**−195**) | | `title.shown` | 629 ms | 614 ms | On top of #6729: `world.first_frame` 970 → 872 ms. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [x] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference none (startup ordering only) ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on PunyDev, against upstream/main at 435730a40, 1 min 58 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +20 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 602 passed (48 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (30 s) | | tests: horizon-client | ✅ 598 passed (29 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): 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) | 🤖 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 06:34:23 +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#7131
No description provided.