From 10e147d53c92d7cce20fe8eef0bf9aea1505cfc3 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 26 Mar 2020 06:54:07 -0700 Subject: [PATCH] getdeps: use half as many jobs by default on windows Summary: This takes some pressure off both cpu and memory on a laptop. Reviewed By: pkaush Differential Revision: D20562474 fbshipit-source-id: a058c71c47f25c3a2b3c1e34a0d0caf83e642021 --- build/fbcode_builder/getdeps/buildopts.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/fbcode_builder/getdeps/buildopts.py b/build/fbcode_builder/getdeps/buildopts.py index 480d8d799..83295b06d 100644 --- a/build/fbcode_builder/getdeps/buildopts.py +++ b/build/fbcode_builder/getdeps/buildopts.py @@ -83,6 +83,14 @@ class BuildOptions(object): import multiprocessing num_jobs = multiprocessing.cpu_count() + if is_windows(): + # On Windows the cpu count tends to be the HT count. + # Running with that level of concurrency tends to + # swamp the system and make hard to perform other + # light work. Let's halve the number of cores here + # to win that back. The user can still specify a + # larger number if desired. + num_jobs = int(num_jobs / 2) if not install_dir: install_dir = os.path.join(scratch_dir, "installed")