Skip to content

Commit aec9f62

Browse files
committed
Update automate.py - speed up builds by increasing ninja jobs
1 parent 0431dbd commit aec9f62

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tools/automate.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@
5959
--build-dir=<dir1> Build directory.
6060
--cef-build-dir=<dir2> CEF build directory. By default same
6161
as --build-dir.
62-
--ninja-jobs=<jobs> How many CEF jobs to run in parallel. To speed up
63-
building set it to number of cores in your CPU.
64-
By default set to cpu_count / 2.
62+
--ninja-jobs=<jobs> How many CEF jobs to run in parallel. By default
63+
sets to CPU threads * 2. If you need to perform
64+
other tasks on computer and it is slowed down
65+
by the build then decrease the number of ninja
66+
jobs.
6567
--gyp-generators=<gen> Set GYP_GENERATORS [default: ninja].
6668
--gyp-msvs-version=<v> Set GYP_MSVS_VERSION.
6769
--use-system-freetype Use system Freetype library on Linux (Issue #402)
@@ -213,12 +215,11 @@ def setup_options(docopt_args):
213215

214216
# ninja_jobs
215217
# cpu_count() returns number of CPU threads, not CPU cores.
216-
# On i5 with 2 cores and 4 cpu threads the default of 4 ninja
217-
# jobs slows down computer significantly.
218+
# On i5 with 2 cores there are 4 cpu threads and will enable
219+
# 8 ninja jobs by default.
218220
if not Options.ninja_jobs:
219-
Options.ninja_jobs = int(multiprocessing.cpu_count() / 2)
220-
if Options.ninja_jobs < 1:
221-
Options.ninja_jobs = 1
221+
Options.ninja_jobs = int(multiprocessing.cpu_count() * 2)
222+
assert Options.ninja_jobs > 0
222223
Options.ninja_jobs = str(Options.ninja_jobs)
223224

224225

0 commit comments

Comments
 (0)