[GH-ISSUE #270] [performance] ~20k section remeshes over 150 s after a world finishes loading #69

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

Originally created by @ludovic111 on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/270

What happens

After a world finishes loading, the client keeps remeshing sections for about two and a half minutes. In that time no generation, decoration or light job is queued.

Measured with #269's status.streaming at RD16 (PerfBench world, seed 1234, Mac mini M4 Pro, offscreen), polled every 250 ms:

seconds after open sections meshed per second
1.7–11.9 (the load: all 901 chunks in by 11.3 s) 6,557
11.9–22 1,548
22–32 496
32–52 255
52–72 116–166
72–143 50–80
143–163 18–22
after 163 ~1

That's about 82,000 meshes for the load, then another 20,000 or so in the tail. During the tail, every stage is idle in 97% of polls (queued/meshing/lighting jump to 40–144 in short bursts, about 3% of polls). generating/decorating/finishing stay at 0.

A sample of the main thread 30–38 s after open shows ordinary frame work: Game::render 49%, Game::tick_world 10% (tick_creatures 7%), update_world 3%. No single hot spot explains the remeshes.

Why it matters

  • Benchmarks. tools/perf_bench.py treated "meshing quiet (under 100 meshes/s)" as loaded, so its RD16 load times (60–150 s) were mostly this tail. #264 and #263 now end a load when every streaming stage is idle.
  • Players. For about 2.5 minutes after joining, the workers keep remeshing 50–1,500 sections a second (around 1.2 cores) with nothing new to show.

Likely causes (to confirm)

Something keeps changing blocks after generation and decays over ~150 s: fluids settling from worldgen springs and lakes, falling blocks, or random ticks (grass, leaves, snow). Each change remeshes its section and neighbours, and a light change dirties a 3×3 of columns. Next step: count block changes by block and cause during the tail, then compare with vanilla, where a fresh RD16 world doesn't keep rebuilding sections at this rate.

Found while benchmarking chunk loading (features item 6). Data: /tmp/perf-agent/pipe-probe16.csv on the Mac mini (2,044 rows of stage counts, fps, CPU and load average).

Originally created by @ludovic111 on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/270 ## What happens After a world finishes loading, the client keeps remeshing sections for about two and a half minutes. In that time no generation, decoration or light job is queued. Measured with #269's `status.streaming` at RD16 (PerfBench world, seed 1234, Mac mini M4 Pro, offscreen), polled every 250 ms: | seconds after `open` | sections meshed per second | |---|---| | 1.7–11.9 (the load: all 901 chunks in by 11.3 s) | 6,557 | | 11.9–22 | 1,548 | | 22–32 | 496 | | 32–52 | 255 | | 52–72 | 116–166 | | 72–143 | 50–80 | | 143–163 | 18–22 | | after 163 | ~1 | That's about 82,000 meshes for the load, then another 20,000 or so in the tail. During the tail, every stage is idle in 97% of polls (`queued`/`meshing`/`lighting` jump to 40–144 in short bursts, about 3% of polls). `generating`/`decorating`/`finishing` stay at 0. A `sample` of the main thread 30–38 s after `open` shows ordinary frame work: `Game::render` 49%, `Game::tick_world` 10% (`tick_creatures` 7%), `update_world` 3%. No single hot spot explains the remeshes. ## Why it matters - **Benchmarks.** `tools/perf_bench.py` treated "meshing quiet (under 100 meshes/s)" as loaded, so its RD16 load times (60–150 s) were mostly this tail. #264 and #263 now end a load when every streaming stage is idle. - **Players.** For about 2.5 minutes after joining, the workers keep remeshing 50–1,500 sections a second (around 1.2 cores) with nothing new to show. ## Likely causes (to confirm) Something keeps changing blocks after generation and decays over ~150 s: fluids settling from worldgen springs and lakes, falling blocks, or random ticks (grass, leaves, snow). Each change remeshes its section and neighbours, and a light change dirties a 3×3 of columns. Next step: count block changes by block and cause during the tail, then compare with vanilla, where a fresh RD16 world doesn't keep rebuilding sections at this rate. Found while benchmarking chunk loading (features item 6). Data: `/tmp/perf-agent/pipe-probe16.csv` on the Mac mini (2,044 rows of stage counts, fps, CPU and load average).
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#69
No description provided.