SoftGPU: Pick the drawing thread count and lingering per platform

Measured on an M1: lingering cost wall time at every length tried, as
waking a thread is cheap on macOS, and seven or eight drawing threads
beat six. So Apple platforms use eight and don't linger, and Android
doesn't linger either (spinning costs battery). Windows and Linux keep
six and lingering, which was measured under WSL2 only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-10 15:01:49 +02:00
1 parent a00ead3cb1
commit af72713272
3 files changed
+21 -3

No files matched your search

+2
View File
@@ -89,6 +89,8 @@ struct TransformUnit::RunJob {
}
// A run after lastGen with chunks left to take, within the time a helper waits for one.
bool WaitForRun(uint32_t lastGen, uint32_t *newGen) {
if (!BinManager::THREADS_LINGER)
return false;
const double until = time_now_d() + LINGER_SECONDS;
do {
const uint64_t v = claim.load(std::memory_order_acquire);