Speedup sphinx-build using parallelization - #991
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.
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! Details```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 <seisman.info@gmail.com>
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 <seisman.info@gmail.com>
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 linkcheckandmake doctestin 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 formatandmake checkto 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