[GH-ISSUE #7713] Dedicated server: tick costs that grow with spread-out players, carts and loaded chunks #3338

Open
opened 2026-11-03 04:07:38 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @rdbtCVS on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7713

Originally assigned to: @rdbtCVS on GitHub.

🤖 Filed by rdbtCVS's AI agent (Claude Code, Claude Opus 5.5), not by rdbtCVS personally.

A dedicated server whose players are spread far apart (a large survival world) spends most of its tick on work that grows with players², carts² or with the number of chunks, not on vanilla's own work.

Measured on horizon-client --dedicated (fast profile, 12 cores): 120 horizon-bots explore bots teleported onto a grid 1 200 blocks apart, view and simulation distance 10, survival, a world generated by a first pass. MSPT about 125–185 ms, p99 up to about 420 ms.

Sampled stacks of the tick thread showed:

  • 30 %: natural spawning's structure lookup (structures_reaching_where → VanillaTerrain::starts_at) building jigsaw starts again. The structure start cache clears a whole shard once it is full (65 536 chunks), which spread players overrun, so villages and outposts are assembled again and again on the tick thread.
  • ~16 %: Streaming::update; Ranges::distance scans every player's area for each wanted column, and ExtraCover gives up (scans) once players are more than about 16 000 blocks apart.
  • ~7 %: minecarts (mineshaft chest carts): push_from_cart and the cart lookups by id are carts², cart_entity_collisions builds every mob's box for every cart, and mob and player pushes test every cart.
  • ~10 %: natural spawning's player checks: SpawnState::players_near and spawning_chunks look at every player for every chunk; every mob's nearest_player looks at every player.
  • Separately, a signal arriving during a socket read (a profiler attaching) disconnected every player: ConnReader::fill treats Interrupted as a lost connection.
Originally created by @rdbtCVS on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7713 Originally assigned to: @rdbtCVS on GitHub. > 🤖 Filed by rdbtCVS's AI agent (Claude Code, Claude Opus 5.5), not by rdbtCVS personally. A dedicated server whose players are spread far apart (a large survival world) spends most of its tick on work that grows with players², carts² or with the number of chunks, not on vanilla's own work. Measured on `horizon-client --dedicated` (`fast` profile, 12 cores): 120 `horizon-bots` explore bots teleported onto a grid 1 200 blocks apart, view and simulation distance 10, survival, a world generated by a first pass. MSPT about 125–185 ms, p99 up to about 420 ms. Sampled stacks of the tick thread showed: - **30 %**: natural spawning's structure lookup (`structures_reaching_where` → `VanillaTerrain::starts_at`) building jigsaw starts again. The structure start cache clears a whole shard once it is full (65 536 chunks), which spread players overrun, so villages and outposts are assembled again and again on the tick thread. - **~16 %**: `Streaming::update`; `Ranges::distance` scans every player's area for each wanted column, and `ExtraCover` gives up (scans) once players are more than about 16 000 blocks apart. - **~7 %**: minecarts (mineshaft chest carts): `push_from_cart` and the cart lookups by id are carts², `cart_entity_collisions` builds every mob's box for every cart, and mob and player pushes test every cart. - **~10 %**: natural spawning's player checks: `SpawnState::players_near` and `spawning_chunks` look at every player for every chunk; every mob's `nearest_player` looks at every player. - Separately, a signal arriving during a socket read (a profiler attaching) disconnected every player: `ConnReader::fill` treats `Interrupted` as a lost connection.
Author
Owner

@rdbtCVS commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6587086851 --> @rdbtCVS commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
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#3338
No description provided.