-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
refactor: re-order headers and forward declarations to improve compile time #5693
refactor: re-order headers and forward declarations to improve compile time #5693
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make -j7 clean && ./autogen.sh && ./configure --enable-crash-hooks --enable-werror --enable-suppress-external-warnings --prefix=
pwd
/depends/aarch64-apple-darwin22.6.0 --disable-ccache && time make -j7
develop:
make -j7 1011.18s user 77.76s system 636% cpu 2:51.15 total
make -j7 1014.88s user 78.29s system 634% cpu 2:52.28 total
5693:
make -j7 1011.06s user 80.08s system 620% cpu 2:55.93 total
make -j7 1004.36s user 78.48s system 636% cpu 2:50.02 total
i.e. no improvement in compilation time for me but I like these changes anyway so
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Good job! The circular dependency "llmq/debug -> llmq/dkgsessionhandler -> llmq/debug" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in test/lint/lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. Good job! The circular dependency "llmq/debug -> llmq/dkgsessionhandler -> llmq/dkgsession -> llmq/debug" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in test/lint/lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced.
6a39a73
to
8518694
Compare
rebased from GH GUI to fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK for squash merge
Issue being fixed or feature implemented
Some headers include other heavy headers, such as
logging.h
,tinyformat.h
,iostream
. These headers are heavy and increase compilation time on scale of whole project drastically because can be used in many other headers.What was done?
Moved many heavy includes from headers to cpp files to optimize compilation time.
In some places added forward declarations if it is reasonable.
As side effect removed 2 circular dependencies:
How Has This Been Tested?
Run build 2 times before refactoring and after refactoring:
make clean && sleep 10s; time make -j18
Before refactoring:
After refactoring:
~5% of improvement for compilation time. That's not huge, but that's worth to get merged
There're several more refactorings TODO but better to do them later by backports:
Breaking Changes
N/A
Checklist: