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
Builds are very slow with lots of pages #561
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
@gilbertbw I am not sure why the theme would affect these build times. Is this project public (i.e. is there a link the repo?) @AakashGfude any ideas here? |
After a bit of digging I have found this issue pydata/pydata-sphinx-theme#381 which I suspect is the cause, I will try the mitigations they propose and see if that leads to a significant speed up.
No, this is a private project |
I am running into the same issue! I have 5000+ pre-executed notebooks (trying to make a catalog of exoplanets), and would like to use the I was initially using Happy to make a small working example -- uploading the 5000+ pages might be a bit challenging! Will share an example shortly. |
Here is a really small working example (only a few files). To build the HTML pages, cd into that zipped dir and use To generate extra notebooks (demonstrating the slow speed), you can duplicate the files in Interestingly -- when I switch the theme to |
I tried
This had no effect. I realised this was because the config option is not available in sphinx-book-theme. Instead I modified A more important issue with writing the full document tree into every page is that each page ends up around 0.25 MB. This is with around 1500 help topics. The whole help ends up around 380 MB, compared to around 3 MB for the .chm file this is replacing. I wonder if it would be possible to replace the sidebar being repeated on every page with an |
@gilbertbw -- interesting!
|
The sort of reuse you're hoping for is not possible without enforcing some sort of JS at runtime requirements -- each page has a slightly different markup there, since the "current page" classes in the various nodes are different. |
I believe that the core challenge here is that when we include all of the site's page links in the sidebar, and when there are many sidebar links, then Sphinx takes a long time to resolve all of the cross refs. I think that we could add more documentation in this theme that cross-links to https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/configuring.html#navigation-depth-and-collapsing-the-sidebar but other than that I don't think there's much we can do to speed up site builds if you also want all of the sub-pages in the navigation bar. |
I may be going off topic for this issue now, but for us the build size is a blocker, rather than the build time. We ship our help with our software, and can not take up this amount of space!
@pradyunsg I have a proposal that I believe works without JS. We prepopulate the sidebar with a unique class for each e.g. with a tree like this, where the class is on the
on the page
or on
@choldgraf When testing this I tried #561 (comment) setting sphinx-book-theme/src/sphinx_book_theme/theme/sphinx_book_theme/components/sbt-sidebar-nav.html Line 19 in 357c659
@avivajpeyi Sorry for the confusion. I mean I literally opened up |
@gilbertbw for complex / large Sphinx sites, I'd recommend giving this tool a shot: https://github.com/executablebooks/sphinx-remove-toctrees#install maybe that'll help |
Closing this one as it's been resolved upstream, and now has documented workarounds |
Hey @choldgraf -- could you point me to the documented workarounds? This page from your comment seems to be broken: Im still having some trouble for my project (may need 5000+ pages 😅 ) |
Yep - check out the docs about that here: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/performance.html |
Another change that helped me in the +5000 ipynb case was removing all matplotlib-inline plots and instead displaying images using markdown cells (e.g. with |
Describe the bug
context
When I do build our project (a fairly large set of help, with 1300 topics) the build is taking much longer than with the '' theme. * * With 'alabaster' the build takes under 2 minutes.
expectation
I expected the build to be not much slower than 'alabaster'
bug
But instead the build takes more than 5 times longer.
problem
This is a problem for people doing builds of large projects because the build time is so long.
Reproduce the bug
List your environment
I am not using jupyter-book
OS: Windows 11 Enterprise 22H2 OS Build 22621.1
sphinx 4.5.0
sphinx-book-theme 0.3.2
The text was updated successfully, but these errors were encountered: