X Tutup
The Wayback Machine - https://web.archive.org/web/20220514014849/https://github.com/python/cpython/pull/92733
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup: build docs in parallel #92733

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented May 12, 2022

sphinx-build has a -j N option:

Distribute the build over N processes in parallel, to make building on multiprocessor machines more effective. Note that not all parts and not all builders of Sphinx can be parallelized. If auto argument is given, Sphinx uses the number of CPUs as N.

https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-j

Test on a new 10-core Mac

make -C Doc clean venv; time make -C Doc html

Results of two runs before

make -C Doc html  64.83s user 0.84s system 98% cpu 1:06.79 total
make -C Doc html  64.61s user 0.84s system 99% cpu 1:06.04 total

Results of two runs after

make -C Doc html  73.28s user 3.09s system 219% cpu 34.826 total
make -C Doc html  74.05s user 3.09s system 221% cpu 34.791 total

That's nearly twice as fast: 1m06s -> 35s

Test on an old dual-core Mac

Results of one run before

make -C Doc html  204.87s user 5.07s system 94% cpu 3:41.28 total

Results of one runs before

make -C Doc html  278.01s user 13.18s system 196% cpu 2:28.38 total

That's about 1.5x faster: 3m42s -> 2m29s

Copy link
Member

@AA-Turner AA-Turner left a comment

Faster is better!

A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants
X Tutup