[PR #745] [MERGED] Worker threads: leave a core for the render and server threads #2775

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/745
Author: @rdbtCVS
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @ludovic111

Base: main ← Head: perf/worker-headroom


📝 Commits (1)

  • fb45034 Worker threads: leave a core for the render and server threads

📊 Changes

1 file changed (+17 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/graphics.rs (+17 -1)

📄 Description

What and why

Fixes #744.

The automatic chunk worker count was cores - 1. With single player now running on its own server thread by default (#731), that one free core has to serve both the render thread and the server thread, and the pool still competes for the rest: while chunks stream, FPS collapses to single digits and the main thread sits around 85% busy.

This reserves a core for the render thread and one more for the integrated server thread (or the OS when single player runs in the frame), so the automatic pool is cores - 2 (at least 1, halved again in battery mode). A manual count set in Options > Video is kept exactly as asked.

Vanilla reference

Horizon-only: vanilla's chunk builder pool is a Java ForkJoinPool; this is Horizon's own Rust worker pool sizing.

Self-check

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at dc1a8a4f3, 11 min 26 s)

Check Result
Scope ✅ 1 files, +17 −1
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ➖ no Python change
rustfmt ✅ (11 s)
clippy ✅ (4 min 6 s)
tests: horizon-client ✅ 915 passed (7 min 9 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick)

Screenshots

None: a thread-count change with no visible UI difference.


🔄 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/745 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/worker-headroom` --- ### 📝 Commits (1) - [`fb45034`](https://github.com/horizon-rust/horizon/commit/fb450342bc55e04e8f6483982971a0b23cbe903b) Worker threads: leave a core for the render and server threads ### 📊 Changes **1 file changed** (+17 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/graphics.rs` (+17 -1) </details> ### 📄 Description ## What and why Fixes #744. The automatic chunk worker count was `cores - 1`. With single player now running on its own server thread by default (#731), that one free core has to serve both the render thread and the server thread, and the pool still competes for the rest: while chunks stream, FPS collapses to single digits and the main thread sits around 85% busy. This reserves a core for the render thread and one more for the integrated server thread (or the OS when single player runs in the frame), so the automatic pool is `cores - 2` (at least 1, halved again in battery mode). A manual count set in Options > Video is kept exactly as asked. ## Vanilla reference Horizon-only: vanilla's chunk builder pool is a Java `ForkJoinPool`; this is Horizon's own Rust worker pool sizing. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at dc1a8a4f3, 11 min 26 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +17 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ➖ no Python change | | rustfmt | ✅ (11 s) | | clippy | ✅ (4 min 6 s) | | tests: horizon-client | ✅ 915 passed (7 min 9 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick) | ## Screenshots None: a thread-count change with no visible UI difference. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:58:56 +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#2775
No description provided.