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

Upgrading my project to version 2.4.0+ multiplies x10 output time #7223

Closed
begonaalvarezd opened this issue Feb 28, 2020 · 3 comments
Closed
Labels
Milestone

Comments

@begonaalvarezd
Copy link

begonaalvarezd commented Feb 28, 2020

I would like to upgrade my project to the latest Sphinx version but I have encountered myself that if I upgrade to version 2.4.0+, when the project is in phase "writing output" it takes >10min to finish, when any other version (eg 2.3.1 and lower until 1.3.1) takes around 100s.

I have discovered that the bottleneck is in the sidebar template:

<div id="toctree">
{{ toctree(maxdepth=6|toint, collapse=False,includehidden=True|tobool) }}
</div>

If I dont add a sidebar then everything is smooth as always, but I do need the sidebar with the entire tree for navigation purporses.

Touching here and there the installed package I have discovered that removing in file environment/adapters/toctree.py line 218 entries.extend(children) stops this slow performance, but of course the toctree creation disappears (in version 2.4.0).

My project is quite big, it has over 400 source files so I understand building the toctree is time consuming, but honestly upgrading and multiplying by 10 the output time...stops me from upgrading to the latest version.

My source files didnt changed from one version to another and I am using Python 3.7.6.

I cannot share with you the source files because the project is private but in case it helps you here goes a link to the current documentation site https://doc.synapticon.com/ (which uses Python 2.7.15 and Sphinx 1.3.1, hence the urge to upgrade) and the conf file of the current under progress upgraded project (to new version):

import sys, os, re
import sphinx_bootstrap_theme

project = 'sncn_documentation'
copyright = u''
author = 'Begoña Álvarez - Boxfish Studio SL'
sys.path.append("./ext")
extensions = [
    'sphinx.ext.ifconfig',
    'sphinx.ext.mathjax',
    'div',
    'tabselection',
]
templates_path = ['_templates']
exclude_patterns = [
    '_build', '_static', 'ext', '_templates', 'Thumbs.db', 
    '.DS_Store', '.support*','.sources*','.doxygen*', 
    'README.rst','**/README.rst','**/pseudocode.rst',
    '**/CHANGELOG.rst', '*.#*'
    ]
html_theme = 'bootstrap'
html_static_path = ['_static']
html_title = "Synapticon Documentation"

html_sidebars = {'**/**': ['toctree.html']}
html_show_sourcelink = False
@jfbu jfbu changed the title Upgrading my project to version 4.2.0+ multiplies x10 output time Upgrading my project to version 2.4.0+ multiplies x10 output time Feb 28, 2020
@jfbu
Copy link
Contributor

jfbu commented Feb 28, 2020

Thanks for reporting. I edited the title to refer to 2.4.0 rather.

@tk0miya
Copy link
Member

tk0miya commented Feb 29, 2020

Thank you for reporting and sorry for inconvenience. I found the reason of the slow. I'll merge #7224 and release bug fix version later.

@tk0miya tk0miya added this to the 2.4.4 milestone Feb 29, 2020
tk0miya added a commit that referenced this issue Feb 29, 2020
Fix #7223: Sphinx builds has been slower since 2.4.0
@tk0miya
Copy link
Member

tk0miya commented Feb 29, 2020

Fixed by #7224
Thank you for reporting!

@tk0miya tk0miya closed this as completed Feb 29, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants