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

build(docs): parallelize generation of dot graphs #3361

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

cathyjf
Copy link
Contributor

@cathyjf cathyjf commented Nov 2, 2024

Building the Sunshine docs is currently agonizingly slow because it
generates many hundreds of dot graphs in serial, without any
parallelization.

This commits sets DOT_NUM_THREADS to 0, which causes doxygen to
determine on its own a reasonable level of parallelization, based on
the number of processors available on the system.

The speed difference with this change is incredibly dramatic. I haven't
performed particularly rigorous testing, but on my fairly weak laptop
building the docs after applying this patch takes about 35 seconds.
Without applying this patch, building the docs instead takes a
ridiculous 135 seconds. This is on an M1 machine with only 4 performance
cores and 4 efficiency cores. On a more powerful machine, the difference
will be even more marked.

Unless there's some reason I'm not aware of why the doc files need to
be created in serial, I recommend enabling parallelization so that it
isn't so painful to build the documentation.

See also:
https://xkcd.com/303

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

@ReenigneArcher
Copy link
Member

ReenigneArcher commented Nov 2, 2024

I think this fails on Windows, or at least it used to. I'll run the workflow and see if that's still the case though.

Edit: here is the original issue on Doxygen's side: doxygen/doxygen#9694

Copy link

codecov bot commented Nov 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.07%. Comparing base (a06d4ae) to head (f3258bc).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3361   +/-   ##
=======================================
  Coverage   11.06%   11.07%           
=======================================
  Files          99       99           
  Lines       17237    17237           
  Branches     8035     8035           
=======================================
+ Hits         1908     1909    +1     
  Misses      12643    12643           
+ Partials     2686     2685    -1     
Flag Coverage Δ
Linux 8.35% <ø> (ø)
Windows 5.23% <ø> (ø)
macOS-13 13.65% <ø> (+0.01%) ⬆️
macOS-14 12.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

@ReenigneArcher
Copy link
Member

I think this fails on Windows, or at least it used to. I'll run the workflow and see if that's still the case though.

Edit: here is the original issue on Doxygen's side: doxygen/doxygen#9694

Seems to be working okay on the first attempt. I'm going to run it a few times because I seem to remember the issue being sort of random.

Building the Sunshine docs is currently agonizingly slow because it
generates many hundreds of dot graphs in serial, without any
parallelization.

This commits sets `DOT_NUM_THREADS` to 0, which causes `doxygen` to
determine on its own a reasonable level of parallelization, based on
the number of processors available on the system.

The speed difference with this change is incredibly dramatic. I haven't
performed particularly rigorous testing, but on my fairly weak laptop
building the docs after applying this patch takes about 35 seconds.
Without applying this patch, building the docs instead takes a
ridiculous 135 seconds. This is on an M1 machine with only 4 performance
cores and 4 efficiency cores. On a more powerful machine, the difference
will be even more marked.

Unless there's some reason I'm not aware of why the doc files need to
be created in serial, I recommend enabling parallelization so that it
isn't so painful to build the documentation.

See also:
    https://xkcd.com/303
@ReenigneArcher ReenigneArcher changed the title feat(docs): parallelize generation of dot graphs build(docs): parallelize generation of dot graphs Nov 2, 2024
@ReenigneArcher ReenigneArcher enabled auto-merge (squash) November 2, 2024 18:29
Copy link

sonarcloud bot commented Nov 2, 2024

@ReenigneArcher ReenigneArcher merged commit 39bab45 into LizardByte:master Nov 2, 2024
36 checks passed
@ReenigneArcher
Copy link
Member

Unfortunately, it looks like this needs to be reverted.

image

ReenigneArcher added a commit that referenced this pull request Nov 3, 2024
ReenigneArcher added a commit that referenced this pull request Nov 3, 2024
Revert "build(docs): parallelize generation of dot graphs (#3361)"

This reverts commit 39bab45.
@cathyjf
Copy link
Contributor Author

cathyjf commented Nov 3, 2024 via email

@ReenigneArcher
Copy link
Member

Fine with me, might be easier to handle it in https://github.com/LizardByte/doxyconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants