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

Performance regression with v0.10rc2 sidebar links for scipy and arrow docs #855

Closed
tupui opened this issue Aug 2, 2022 · 7 comments · Fixed by #878
Closed

Performance regression with v0.10rc2 sidebar links for scipy and arrow docs #855

tupui opened this issue Aug 2, 2022 · 7 comments · Fixed by #878
Labels
help wanted Extra attention is needed impact: block-release Should block a release from happening. Only use if this is a critical problem we don't want to ship
Milestone

Comments

@tupui
Copy link
Contributor

tupui commented Aug 2, 2022

While testing the RC for 0.10, I noticed that the Sphinx build time significantly increased.

Here is an example of CI timing out now with RC2 scipy/scipy#16660
On main, we use 0.9 and there is no apparent issue.

@jorisvandenbossche
Copy link
Member

Comparing 0.9.0 with 0.10.0rc2 and testing this with the Arrow docs, I also see some slowdown: the total build went from around 9 minutes to around 13.5min (both using the same sphinx version (still 4.2 in my test env), only the theme version differed).

I profiled both cases for the writing files phase (as that phase visually (from the live progress output) seemed to show a slowdown). From a quick look at those profiles, it seems that generate_nav_html is now called more than before. Although I would expect that

{# Create the sidebar links HTML here to re-use in a few places #}
{# If we have no sidebar links, pop the links component from the sidebar list #}
{%- set sidebar_nav_html = generate_nav_html("sidebar",

should actually ensure it's only called once.

Profiles

With 0.9.0:
profile-sphinx-09

With 0.10.0rc2:
profile-sphinx-010

@jarrodmillman jarrodmillman added this to the 0.10 milestone Aug 4, 2022
@choldgraf
Copy link
Collaborator

choldgraf commented Aug 6, 2022

I wonder if the problem is because we now generate the navbar in two places. First in the navbar, and a second time in the sidebar (so that the navbar shows in the sidebar at the top on mobile). Maybe it re-calculates the links each time?

Either way, this is almost certainly because of how the navigation links are generated, that's by far the most time we spend. I think that's where I'd look to improve the performance.

@choldgraf choldgraf changed the title Performance regression Performance regression with v0.10rc2 sidebar links Aug 6, 2022
@jarrodmillman jarrodmillman added the impact: block-release Should block a release from happening. Only use if this is a critical problem we don't want to ship label Aug 8, 2022
@choldgraf
Copy link
Collaborator

I think that this issue is potentially a simpler way to resolve this problem:

@choldgraf
Copy link
Collaborator

I looks like the PR I linked above doesn't really speed things up (at least for the SciPy docs).

I am not sure what to do here, I don't have time to debug this issue, can anybody try to find a fix for this? Otherwise we are just going to be stuck in Release Candidate purgatory for a while I guess.

@choldgraf choldgraf added the help wanted Extra attention is needed label Aug 17, 2022
@drammock
Copy link
Collaborator

I will try to have a look tomorrow or friday. after that I'm at a project-specific hackathon the following week, so may need to pass the baton.

@choldgraf
Copy link
Collaborator

copied over from #878

I was not able to reproduce the slow-down reported in this issue. It seems like main is in-fact faster than 0.9. To conclude this I did the following analysis:

This is what resulted:

image

This is confusing to me, because it's significantly faster on main compared with the last major release.

So are we really sure that there is a significant slow-down?

@choldgraf choldgraf changed the title Performance regression with v0.10rc2 sidebar links Performance regression with v0.10rc2 sidebar links for scipy and arrow docs Aug 23, 2022
@tupui
Copy link
Contributor Author

tupui commented Aug 24, 2022

Also some findings from #878.

On SciPy the slowdown comes from the use of autosummary templates. Removing these allows to have usual build times. I will open an issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed impact: block-release Should block a release from happening. Only use if this is a critical problem we don't want to ship
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants