[PR #6619] [MERGED] perf_bench --server: clients join a local Horizon or vanilla dedicated server, optionally with a bot crowd #6987

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

📋 Pull Request Information

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

Base: main ← Head: perf/bench-server-join


📝 Commits (4)

  • b73e5b7 perf_bench --server horizon|vanilla: clients join a local dedicated server
  • 2b78d26 perf_bench --server-bots N: a crowd of horizon-bots and a scene that flies over them
  • 50fdee8 perf_bench report: runs without --server (tests' Namespace) have no server condition
  • 84ad920 Merge remote-tracking branch 'origin/main' into perf/bench-server-join

📊 Changes

4 files changed (+165 additions, -14 deletions)

View changed files

📝 crates/horizon-bots/src/main.rs (+6 -1)
📝 mods/horizon/src/bench/java/dev/horizonlab/bench/VanillaBench.java (+13 -1)
📝 tests/test_perf_bench.py (+4 -0)
📝 tools/perf_bench.py (+142 -12)

📄 Description

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

What

tools/perf_bench.py measured clients only in a world they create. Players play on servers, so this adds:

  • --server horizon|vanilla: perf_bench starts a local dedicated server (Horizon's --dedicated, or the player's own 26.3 server.jar) with the bench's seed, view distance and an op'd offline Bench player. Every client (Horizon, vanilla, vanilla-mods) joins it instead of creating a world. startup.join_ms is the time from connect to loaded, and each scene is reached with /tp. A fresh server world gets one unmeasured warm-up join first.
  • --server-bots N: N horizon-bots walk around the spawn for the whole run, and a crowd scene flies over them. horizon-bots now prints the first bot's spawn position for this.
  • The vanilla driver mod (VanillaBench.java) connects with ConnectScreen when the script names a server.

Tooling only (skip-release).

First numbers (Mac mini M4 Pro, 1280x720 offscreen, RD 16, n=2, Mac busy: load 12-62)

Horizon = main 1bd24e4 release build. The village scene, one client:

Horizon vanilla vanilla-mods
join to loaded, Horizon server 1.06 s 4.93 s 5.64 s
join to loaded, vanilla server 5.16 s 7.36 s 5.56 s
scene load after /tp, Horizon server 0.78 s 0.71 s 0.63 s
scene load after /tp, vanilla server 1.67 s 1.44 s 1.15 s
avg fps (1% low), Horizon server 672 (209) 204 (50) 268 (55)
RSS 0.8 GB 1.3 GB 1.5 GB

--server-bots 100, the crowd scene:

server Horizon vanilla vanilla-mods
Horizon avg / 1% / 0.1% fps 497 / 231 / 159 78 / 18 / 13 126 / 28 / 17
vanilla avg / 1% / 0.1% fps 478 / 175 / 129 50 / 7.0 / 5.4 70 / 6.6 / 4.9
Horizon RSS 0.80 GB 1.38 GB 1.61 GB

With 100 bots on the vanilla server, join times swung from 8 s to 55 s for every client, because that server was saturated on the busy Mac. Those numbers are left out.

RD 32, flying over the village while chunks stream in (same Mac, 1280x720, n=2):

server Horizon vanilla vanilla-mods
Horizon join to loaded 3.64 s 9.70 s 8.80 s
Horizon scene load after /tp 0.63 s 1.21 s 1.53 s
Horizon avg / 1% / 0.1% fps 417 / 220 / 193 145 / 57 / 32 193 / 26 / 13
vanilla join to loaded 9.33 s (8.1-10.6) 8.86 s (6.0-11.7) 10.28 s
vanilla scene load after /tp 1.36 s 0.80 s 0.88 s
vanilla avg / 1% / 0.1% fps 406 / 203 / 157 117 / 27 / 15 214 / 72 / 52
RSS 1.0 GB 1.8 GB 2.6 GB

What these runs found (follow-ups, not in this PR):

  • The scene load after /tp on the vanilla server loses to vanilla, at RD 16 and RD 32. At RD 16, the network side of a teleport is done in 0.84 s (headless client trace). The rest of the 1.67 s is meshing and upload.
  • On the Horizon server, there are about 0.3 s before the first new column arrives: lan/hub.rs next_batch sends only chunks that are already loaded and lit.

Self-check

pr_ready (tools/pr_ready.py --quick on playhorizon, against origin/main at 2556a20c7, 1 min 29 s)

Check Result
Scope ✅ 4 files, +165 −14
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 602 passed (1 min 10 s)
rustfmt ✅ (13 s)
clippy ✅ (2 s)
tests: horizon-bots ✅ 9 passed (1 s)
doc tests ➖ no library touched
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 ➖ 26 affected, to run in CI (--quick): armor_stand_frost, arrow_wind_charge, blending, block_tint, boat_authority, boat_paddle_reset, boat_submerged, dragon_render, enchantment_components, held_item_stack, inline_object, item_use_order and 14 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

VanillaBench.java is compiled at run time by perf_bench: every vanilla and vanilla-mods number above came from this branch's driver.

🤖 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/6619 **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/bench-server-join` --- ### 📝 Commits (4) - [`b73e5b7`](https://github.com/horizon-rust/horizon/commit/b73e5b7c98bfafb5995daf44c1f8f6ee82ffcec8) perf_bench --server horizon|vanilla: clients join a local dedicated server - [`2b78d26`](https://github.com/horizon-rust/horizon/commit/2b78d2638efca4d95bdc71408b9fce7c8dbac6dc) perf_bench --server-bots N: a crowd of horizon-bots and a scene that flies over them - [`50fdee8`](https://github.com/horizon-rust/horizon/commit/50fdee86143284bd3df3d445464d9cbc9e70e499) perf_bench report: runs without --server (tests' Namespace) have no server condition - [`84ad920`](https://github.com/horizon-rust/horizon/commit/84ad92068f59043071d89711b88e91bec8c0e07b) Merge remote-tracking branch 'origin/main' into perf/bench-server-join ### 📊 Changes **4 files changed** (+165 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-bots/src/main.rs` (+6 -1) 📝 `mods/horizon/src/bench/java/dev/horizonlab/bench/VanillaBench.java` (+13 -1) 📝 `tests/test_perf_bench.py` (+4 -0) 📝 `tools/perf_bench.py` (+142 -12) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What `tools/perf_bench.py` measured clients only in a world they create. Players play on servers, so this adds: - `--server horizon|vanilla`: perf_bench starts a local dedicated server (Horizon's `--dedicated`, or the player's own 26.3 `server.jar`) with the bench's seed, view distance and an op'd offline `Bench` player. Every client (Horizon, vanilla, vanilla-mods) joins it instead of creating a world. `startup.join_ms` is the time from connect to loaded, and each scene is reached with `/tp`. A fresh server world gets one unmeasured warm-up join first. - `--server-bots N`: N horizon-bots walk around the spawn for the whole run, and a `crowd` scene flies over them. horizon-bots now prints the first bot's spawn position for this. - The vanilla driver mod (`VanillaBench.java`) connects with `ConnectScreen` when the script names a server. Tooling only (`skip-release`). ## First numbers (Mac mini M4 Pro, 1280x720 offscreen, RD 16, n=2, Mac busy: load 12-62) Horizon = main 1bd24e4 release build. The village scene, one client: | | Horizon | vanilla | vanilla-mods | |---|---|---|---| | join to loaded, Horizon server | 1.06 s | 4.93 s | 5.64 s | | join to loaded, vanilla server | 5.16 s | 7.36 s | 5.56 s | | scene load after /tp, Horizon server | 0.78 s | 0.71 s | 0.63 s | | scene load after /tp, vanilla server | 1.67 s | 1.44 s | 1.15 s | | avg fps (1% low), Horizon server | 672 (209) | 204 (50) | 268 (55) | | RSS | 0.8 GB | 1.3 GB | 1.5 GB | `--server-bots 100`, the crowd scene: | server | | Horizon | vanilla | vanilla-mods | |---|---|---|---|---| | Horizon | avg / 1% / 0.1% fps | 497 / 231 / 159 | 78 / 18 / 13 | 126 / 28 / 17 | | vanilla | avg / 1% / 0.1% fps | 478 / 175 / 129 | 50 / 7.0 / 5.4 | 70 / 6.6 / 4.9 | | Horizon | RSS | 0.80 GB | 1.38 GB | 1.61 GB | With 100 bots on the vanilla server, join times swung from 8 s to 55 s for every client, because that server was saturated on the busy Mac. Those numbers are left out. RD 32, flying over the village while chunks stream in (same Mac, 1280x720, n=2): | server | | Horizon | vanilla | vanilla-mods | |---|---|---|---|---| | Horizon | join to loaded | 3.64 s | 9.70 s | 8.80 s | | Horizon | scene load after /tp | 0.63 s | 1.21 s | 1.53 s | | Horizon | avg / 1% / 0.1% fps | 417 / 220 / 193 | 145 / 57 / 32 | 193 / 26 / 13 | | vanilla | join to loaded | 9.33 s (8.1-10.6) | 8.86 s (6.0-11.7) | 10.28 s | | vanilla | scene load after /tp | 1.36 s | 0.80 s | 0.88 s | | vanilla | avg / 1% / 0.1% fps | 406 / 203 / 157 | 117 / 27 / 15 | 214 / 72 / 52 | | | RSS | 1.0 GB | 1.8 GB | 2.6 GB | What these runs found (follow-ups, not in this PR): - The scene load after `/tp` on the vanilla server loses to vanilla, at RD 16 and RD 32. At RD 16, the network side of a teleport is done in 0.84 s (headless client trace). The rest of the 1.67 s is meshing and upload. - On the Horizon server, there are about 0.3 s before the first new column arrives: `lan/hub.rs` `next_batch` sends only chunks that are already loaded and lit. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on playhorizon, against origin/main at 2556a20c7, 1 min 29 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +165 −14 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 602 passed (1 min 10 s) | | rustfmt | ✅ (13 s) | | clippy | ✅ (2 s) | | tests: horizon-bots | ✅ 9 passed (1 s) | | doc tests | ➖ no library touched | | 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 | ➖ 26 affected, to run in CI (--quick): armor_stand_frost, arrow_wind_charge, blending, block_tint, boat_authority, boat_paddle_reset, boat_submerged, dragon_render, enchantment_components, held_item_stack, inline_object, item_use_order and 14 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | `VanillaBench.java` is compiled at run time by perf_bench: every vanilla and vanilla-mods number above came from this branch's driver. 🤖 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:31:00 +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#6987
No description provided.