Skip to content

perf(tuner): keep every tuner computation within 80% of logical CPUs - #1003

Merged
kirillDevPro merged 1 commit into
mainfrom
perf/tuner-cpu-budget-80
Oct 16, 2026
Merged

kirillDevPro merged 1 commit into
mainfrom
perf/tuner-cpu-budget-80

Conversation

@kirillDevPro

Copy link
Copy Markdown
Collaborator

What & why

The tuner could take more than 80% of the CPU: the search pool was sized at ~90% of logical CPUs, and the variant-column pool, readiness pass, table replay and By-coin auto-pick ran beside it, partly in rayon's global pool.

  • One budget (TUNER_CPU_PCT = 80) carves both the search pool and the column pool so their sum fits.
  • The readiness pass, table replay and By-coin auto-pick run inside the budgeted pools; read cancellation is carried into them.
  • rayon's global pool is capped at startup as a backstop.
  • The search time estimate uses the real pool size.

How to verify

cargo test -p moon-core threshold_search (budget arithmetic for 1–56 CPUs), cargo test -p moon-ui-gpui --bin moonterminal estimate.

Known limits: on 1–2 CPU machines search + column still take 2 threads; a few light per-row replays after a tape fetch and the manual By-coin pick stay on their own single thread.

The search pool alone took about 90% of the CPUs, and the variant-column
pool, the readiness pass, the table replay and the By-coin auto-pick ran
beside it on top of that budget, some of them in rayon's global pool.

One budget now sizes both tuner pools so their sum stays at 80% of the
logical CPUs, those computations run inside the pools with read
cancellation carried along, rayon's global pool is capped at startup as
a backstop, and the search time estimate uses the real pool size.
@kirillDevPro
kirillDevPro merged commit 8c56d36 into main Oct 16, 2026
10 checks passed
@kirillDevPro
kirillDevPro deleted the perf/tuner-cpu-budget-80 branch October 16, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant