[android] Constraint thread freedom on pipeline workers

This commit is contained in:
CamilleLaVey 2026-04-24 12:09:10 -04:00 • committed by lizzie
parent 17e2be173c
commit f303269d44

View file

@ -325,9 +325,8 @@ size_t GetTotalPipelineWorkers() {
const size_t max_core_threads = const size_t max_core_threads =
std::max<size_t>(static_cast<size_t>(std::thread::hardware_concurrency()), 2ULL) - 1ULL; std::max<size_t>(static_cast<size_t>(std::thread::hardware_concurrency()), 2ULL) - 1ULL;
#ifdef ANDROID #ifdef ANDROID
// Leave at least one core free on Android. Previously we reserved two, but // Leave at least 3 cores free on Android to avoid stalling the system.
// shipping builds benefit from one extra compilation worker. constexpr size_t free_cores = 3ULL;
constexpr size_t free_cores = 1ULL;
if (max_core_threads <= free_cores) { if (max_core_threads <= free_cores) {
return 1ULL; return 1ULL;
} }