-
Notifications
You must be signed in to change notification settings - Fork 229
Speedup sphinx-build using parallelization #991
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
Conversation
Distribute sphinx-build over several processes in parallel to make building on multiprocessor machines faster. Using 'auto' which equals the number of CPUs available. See docs at https://www.sphinx-doc.org/en/3.x/man/sphinx-build.html#cmdoption-sphinx-build-j.
/test-gmt-dev |
Perhaps you have to change a python file to trigger the workflows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parallelization doesn't seem to speed things up much on Github Actions CI. Scheduled test on master was 3m 47s while doc build on this PR was 3m 53s (a bit slower, but about the same). Maybe the Github Actions CI doesn't have that many CPU cores allocated? Vercel doc build time is still 7-8min.
Testing locally (8 CPU cores) does show a bit of speedup but not very significant, maybe a few tens of seconds.
Most of the time is spent on running Python scripts. Maybe -j auto doesn't work for sphinx-gallery? |
Possibly related to sphinx-doc/sphinx#4575. P.S. Might need to run full tests to check, as I saw some issues with running parallel sphinx-build on Windows. |
Hmm, 5 test failures on Windows GMT dev tests again at https://github.com/GenericMappingTools/pygmt/runs/2026668071?check_suite_focus=true#step:15:1245. I think they're unrelated but it does looks scary!
```python-traceback
________________________ test_gmt_compat_6_is_applied _________________________
capsys = <_pytest.capture.CaptureFixture object at 0x0000020835D65E80>
Error: Ensure that users with old gmt.conf files won't get pygmt-session [ERROR]:
Error: "pygmt-session [ERROR]: GMT_COMPATIBILITY:"
Error: AssertionError: assert 'end [ERROR]:...rmissions?]\n' == '' C:\Miniconda3\envs\test\lib\site-packages\pygmt\tests\test_session_management.py:47: AssertionError During handling of the above exception, another exception occurred: capsys = <_pytest.capture.CaptureFixture object at 0x0000020835D65E80>
Error: Ensure that users with old gmt.conf files won't get pygmt-session [ERROR]:
Error: "pygmt-session [ERROR]: GMT_COMPATIBILITY:"
E AssertionError: assert False C:\Miniconda3\envs\test\lib\site-packages\pygmt\tests\test_session_management.py:51: AssertionError
|
It seems adding -j auto doesn't speed up at all. |
As -j auto doesn't work as we expected, I think we can just rename the issue title and only remove the |
There's no speedup on the Github Actions CI, but I think it helps a bit locally, shaving off a few tens of seconds on my 8-core machine when I tested, so perhaps ok to keep |
Building the documentation takes 130 s in the master branch, and 120 s in this branch. It's even faster if you move -j auto to the first line, i.e.,
|
It's not true, but still adding -j auto to |
Co-Authored-By: Dongdong Tian <[email protected]>
Distribute sphinx-build over several processes in parallel to make building on multiprocessor machines faster. Using 'auto' which equals the number of CPUs available. See docs at https://www.sphinx-doc.org/en/3.x/man/sphinx-build.html#cmdoption-sphinx-build-j. * Move `-j auto` to SPHINXOPTS Co-authored-by: Dongdong Tian <[email protected]>
Description of proposed changes
Distribute sphinx-build over several processes in parallel to make building on multiprocessor machines faster. Using 'auto' which equals the number of CPUs available. This should speed up running
make html
,make linkcheck
andmake doctest
in the 'doc/' folder and cut down on time waiting for the Vercel Continuous Documentation and Github Actions Continuous Integration steps to run.References:
Addresses #584.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version