https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107613

            Bug ID: 107613
           Summary: sphinx-build is slow for gccint manual
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: burnus at gcc dot gnu.org
  Target Milestone: ---

I noticed the manual build takes quite some time (~90 seconds):

$ /usr/bin/sphinx-build -b texinfo -d
/dev/shm/objdir/gcc/doc/gccint/info/doctrees  
/home/marxin/Programming/gcc/gcc/doc/gccint
/dev/shm/objdir/gcc/doc/gccint/info/texinfo -j auto
...
resolving references...

Apparently, when I look at the cProfile I get something like:

   Ordered by: cumulative time
   List reduced from 5417 to 60 due to restriction <60>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
...
        1    0.000    0.000   69.225   69.225
/usr/lib/python3.10/site-packages/sphinx/environment/__init__.py:623(resolve_references)
        1    0.000    0.000   69.225   69.225
/usr/lib/python3.10/site-packages/sphinx/environment/__init__.py:627(apply_post_transforms)
        1    0.000    0.000   69.076   69.076
/usr/lib/python3.10/site-packages/sphinx/transforms/__init__.py:75(apply_transforms)
        1    0.000    0.000   69.076   69.076
/usr/lib/python3.10/site-packages/docutils/transforms/__init__.py:159(apply_transforms)
...
     3440    1.101    0.000   55.550    0.016
/usr/lib/python3.10/site-packages/sphinx/domains/cpp.py:4978(direct_lookup)
  1561334    0.602    0.000   54.540    0.000
/usr/lib/python3.10/site-packages/sphinx/domains/cpp.py:4050(get_newest_id)


So 55 seconds are spent in cpp domain direct_lookup function.
We've got ~1000 C++ function defines and so let me report that to upstream.

Reply via email to