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
Add an option to know which files slow down the build #6446
Comments
+0: interesting. I can accept if this also supports parallel build. |
Supporting parallel builds seems more difficult since this would mean passing the times to the parent process through This is what I have now: master...saimn:read-time
|
I just made an simple extension to measure reading durations. It measures the duration between two events I'm wondering which bundled or separated package is better for this extension. |
Nice! Initially I thought about making an extension but could not find the appropriate events. |
Oh, sorry. this is an example of the extension. |
I think it would be better if it is bundled to the Sphinx package. |
Close #6446: Add sphinx.ext.durations to inspect durations of build
I added |
Great, thanks! |
@tk0miya, in http://www.sphinx-doc.org/en/master/usage/extensions/duration.html it is said that this feature was new in v2.3. However, trying to use it with v2.3.1 produces the following error:
According to https://readthedocs.org/projects/sphinx/downloads/pdf/master/ (page 318) it was added in v2.4 not v2.3. This is coherent with your comment above. Should the web site be fixed? /cc @Paebbels |
Ah, you're right. It's my wrong. Fixed. |
Is your feature request related to a problem? Please describe.
While investigating a bit why astropy's documentation build is slow (astropy/astropy#7080), I wanted to know which RST files take the most time to parse.
So I quickly added some code in sphinx to report the slowest files : https://gist.github.com/saimn/bd275de04bfdb975c1781b0f666919de
This also include the memory usage, but this is probably not necessary (we had a file taking several Gb of memory because of a bug in matplotlib's
hist
function).Describe the solution you'd like
It would be handy to have an option to report the N slowest files, similar to pytest's
--durations
option.My hack above only reports the read (and parse) time, which I think is the most interesting, I'm not sure if the same would be useful for the other stages?
The text was updated successfully, but these errors were encountered: