[meta] Some efforts to reduce the aggregated number of included files
Categories
(Firefox Build System :: General, task)
Tracking
(Not tracked)
People
(Reporter: sg, Assigned: sg)
References
(Blocks 1 open bug)
Details
(Keywords: meta)
Attachments
(5 files, 1 obsolete file)
This bug is a meta bug to aggregate some efforts to reduce the aggregated number of included files across the code base, in order to reduce the build times on both incremental and clobber builds.
Preliminary measurements of these efforts show:
- Clang frontend time for a clobber build reduces by 12.6% from 7487s to 6541s
- Wall time for a clobber build reduces by 6% from 881s to 828s (the effect is less visible here e.g. because of the significant impact of Rust compilation)
- Aggregated number of include files reduces by 21% from 2.8 million to 2.2 million
- Number of unified translation units affected by a change to dom/base/Document.h reduces by 52% from 1161 to 557, build wall time reduces by 49% from 535s to 274s
- Number of unified translation units affected by a change to js/StructuredClone.h reduces by 34% from 1290 to 855, build wall time reduces by 29% from 540s to 382s
- Number of unified translation units affected by a change to tools/profiler/public/GeckoProfiler.h reduces by 36% from 1541 to 987, build wall time reduces by 27% from 571s to 417s (this still seems to be quite a bit more than necessary)
- Build wall time after adding a message to PBrowser.ipdl reduces by 10% from 170s to 154s
All numbers are for Linux debug builds on my workstation.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Comment hidden (obsolete) |
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
An overview of how the individual patches affect the aggregated number of included headers is found in the attachment.
Note that patches may build upon the effects of earlier patches, so removing a patch that individually doesn't have a significant impact may have adverse effects.
Updated•4 years ago
|
Comment 4•4 years ago
|
||
excellent work, bravo
can you share how you generated this?
Assignee | ||
Comment 5•4 years ago
|
||
Script to determine incremental build times, based on some scenarios of modifications. The last scenario requires files to be provided for the current revision manually, the other just touch existing files to trigger rebuilds.
Assignee | ||
Comment 6•4 years ago
|
||
Script for measuring clobber build time.
ClangBuildAnalyzer is from https://github.com/aras-p/ClangBuildAnalyzer
The mozconfig must contain CXXFLAGS="$CXXFLAGS -ftime-trace"
Assignee | ||
Comment 7•4 years ago
|
||
Script to determine the aggregated number of included files across the build.
It's disregarding the unified build and uses the individual files instead. It counts included files only once per translation unit (if they are properly guarded by header guards).
The script does a bit more than that, which I played around with, and I only partially removed the code for that. Sorry for the confusion.
Assignee | ||
Comment 8•4 years ago
|
||
(In reply to Sylvestre Ledru [:Sylvestre] from comment #4)
excellent work, bravo
Thanks!
can you share how you generated this?
Sure :) Unfortunately, I don't have that in a state that can be readily applied by everyone, as they contain some hard-coded local stuff, but I'll still share what I used. There are two shell scripts and one python script I attached. To generate the table, I ran the python script as:
for a in $(hg ls | tail -n +2 | cut -c 1-6) ; do hg up $a >/dev/null ; ./mach build export 2>/dev/null >/dev/null ; echo $(hg ls | grep $a) $(~/src/fftools/list_includes.py 2>/dev/null) ; done | tee include-counts.txt
Assignee | ||
Comment 9•4 years ago
|
||
With further patches, which are not yet on Phabricator,
- Wall time for a clobber build is now reduced to 799s
- Frontend time for a clobber build is now reduced to 6399s
- Aggregated number of included files is now reduced to 2.03 million
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
Comment 12•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 13•4 years ago
|
||
All blocking bugs are now resolved, so this specific effort is complete.
Updated•4 years ago
|
Updated•4 years ago
|
Description
•