-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Improve build speed [manually] (forward-declarations/clean up includes/etc.) #57641
Improve build speed [manually] (forward-declarations/clean up includes/etc.) #57641
Conversation
This is a good start, nice work 🙂 Did you see #57569 by the way? |
f3e8ed7
to
a0a7f43
Compare
@Calinou Thats quite interesting, will see what I can do with that :) |
There's include-what-you-use but I don't know how difficult it would be to run on a SCons-using codebase. |
851b17d
to
2582b0f
Compare
It's not too difficult, it just needs a wrapper script. I ran it a few years ago, but it's not trivial to make good use of it as it affects the whole codebase. When using it, a good first step would be to try to sort includes in |
2582b0f
to
98ed5d8
Compare
@Calinou @akien-mga
EDIT: Works now. See #57760. |
b2ff322
to
a93301d
Compare
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.
Excellent work overall! I reviewed the whole diff and commented on some style issues and a couple problems, but that's a big improvement already as is.
220ce3b
to
b396fd4
Compare
Fixed all issues, except the ones regarding the dependency editor header as suggested. I was tempted to fix those, but there are still many places left where a similar cleanup could be done so this is indeed material for another PR :) |
Thanks a lot! I know this was tedious work but it's really appreciated :) |
This PR aims to improve compilation time by forward-declaring some classes whenever possible/when it makes sense and cleaning up/moving some include statements. There is still some more room to improve, but I think this should be done in subsequent PRs as this manual process of finding optimization opportunities can be very time consuming.
Changes:
EditorFileDialog
andEditorNode
to several classes. This is already done in some cases, but not consistently.file_dialog.h
flow_container.h
as it was used as a base class which can cause problems. (could be moved to a separate PR)EditorNode
and sort forward declarationseditor
includes) absolute for consistencySome benchmarks (as of Feb 11 2022):
[Time of rebuild. before -> this PR]
Change in progress_dialog.h
28s -> 23s (~17% reduction)
Change in dependency_editor.h
25s -> 23s (~8% reduction)
Change in editor_data.h
3:55m -> 3:01m (~23% reduction)
Change in file_dialog.h
3:47m -> 21s (~91% reduction)
Change in line_edit.h
4:37m -> 3:50m (~17% reduction)
Changed all files above:
4:30m -> 3:56 (~13% reduction)