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

Add faster TocTree._toctree_copy method #10988

Merged
merged 4 commits into from Jan 2, 2023
Merged

Commits on Nov 23, 2022

  1. Speed up navigation generation for "-M html" builder

    This was pair-programmed with @ax-lothas
    
    As in the standalone html builder the navigation is flattened out
    for every single html page, the code needs to create a specialized toctree
    for every html page.
    
    Previously this was done by deep-copying the complete navigation toctree
    and then stripping out the parts not needed on the particular page.
    
    With this change the code only (deep)-copies the needed parts of the toctree
    avoiding unnecessary copying+throwing-away
    
    The performance improvements seems to be smaller for smaller page counts and
    get bigger the more pages are involved:
    
    +----------------------------------+-----------+-----------+-------------------+
    |         830 Source Files         |   5.3.0   |  5.3.0mod |       Ratio       |
    +----------------------------------+-----------+-----------+-------------------+
    |          SingleThreaded          |  49.137 s |  43.517 s | 0.885625903087287 |
    | Parallel (auto, 16 logical CPUs) |  13.334 s |  12.849 s | 0.963626818659067 |
    +----------------------------------+-----------+-----------+-------------------+
    
    +----------------------------------+-----------+-----------+-------------------+
    |        6166 Source Files         |   5.3.0   |  5.3.0mod |       Ratio       |
    +----------------------------------+-----------+-----------+-------------------+
    |          SingleThreaded          | 907.497 s | 521.945 s | 0.575147906825036 |
    | Parallel (auto, 16 logical CPUs) | 195.400 s | 150.139 s | 0.768367451381781 |
    +----------------------------------+-----------+-----------+-------------------+
    hofmandl1 committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    07d965c View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2022

  1. Configuration menu
    Copy the full SHA
    2bfbfe7 View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2023

  1. Merge branch 'master' into toctree-copy

    # Conflicts:
    #	sphinx/environment/adapters/toctree.py
    AA-Turner committed Jan 2, 2023
    Configuration menu
    Copy the full SHA
    120654c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d0904a9 View commit details
    Browse the repository at this point in the history