Skip to content

Conversation

@duposyl
Copy link
Contributor

@duposyl duposyl commented Nov 22, 2022

The documentation build has been taking hours on GitHub while it was taking minutes on my local machine. The issue was traced back to the version of Python. Building the doc using Python 3.8 (which is what I had locally) is fast. Building it with Python 3.9 or 3.10 is very slow. This was verified by running the doc build on GitHub using these different versions:

image

After further investigation, the issue was traced to the numpydoc docstring validation:

image

The numpydoc_validation_checks option in the Sphinx configuration is what causes the slowdown. The call to inspect.getsourcelines at https://github.com/numpy/numpydoc/blob/main/numpydoc/validate.py#L213 gets much slower starting with Python >= 3.9, and is what is causing the bad doc build performance.

So, in order to have decent performance during CI, as a workaround, we decided to turn off the numpydoc validation for the time being. A separate issue (#47) has been created to revisit this in the future when we are ready to dig into the numpydoc warnings.

Note that this change also turns on the parallel option for Sphinx, as this helps independently with performance a little bit too.

@github-actions github-actions bot added the maintenance Generic maintenance related label Nov 22, 2022
@duposyl duposyl changed the title Experimenting with Sphinx "-j auto" distributed build option Investigating doc build performance Nov 23, 2022
@github-actions github-actions bot added the docs Issues related to documentation label Nov 24, 2022
- Removing matrix build using multiple python versions.
- Commenting out numpydoc checks.
- Restoring tox configuration to initial state.
@duposyl duposyl changed the title Investigating doc build performance Improve doc build performance Nov 28, 2022
@duposyl duposyl marked this pull request as ready for review November 28, 2022 20:38
@duposyl duposyl requested a review from jorgepiloto November 28, 2022 20:39
@jorgepiloto
Copy link
Member

Thanks a lot for such a detailed description, @duposyl. Let us keep track of that issue. Merging 🚀

@jorgepiloto jorgepiloto merged commit 4551c15 into main Nov 30, 2022
@jorgepiloto jorgepiloto deleted the CI/doc-build-performance branch November 30, 2022 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Issues related to documentation maintenance Generic maintenance related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants