Closed Bug 1527371 Opened 8 months ago Closed 4 months ago

Consider passing -time to lld-link to get link time breakdowns

Categories

(Firefox Build System :: Toolchains, enhancement)

enhancement
Not set

Tracking

(firefox69 fixed)

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: dmajor, Assigned: dmajor)

Details

Attachments

(1 file)

COFF-flavored lld collects times on various phases of linking: http://llvm-cs.pcc.me.uk/tools/lld/include/lld/Common/Timer.h/rTimer

These might be interesting to include in logs. In particular, ICF has bit us a couple times. Also, type merging might help us decide whether ghash would be a benefit.

Internally these numbers are always collected, so displaying them doesn't cost us anything more than printfs and some screen lines. The latter might be annoying for local edit-compile cycles, so maybe only do this on automation?

Just as an example here's an output from a local build where I re-link xul.dll after touching nsExceptionHandler.cpp:

0:17.14 toolkit/library/xul.dll
0:34.49 Input File Reading: 1170 ms ( 6.8%)
0:34.49 GC: 839 ms ( 4.9%)
0:34.49 ICF: 1215 ms ( 7.0%)
0:34.49 Code Layout: 668 ms ( 3.9%)
0:34.49 PDB Emission (Cumulative): 13089 ms ( 75.6%)
0:34.49 Add Objects: 9154 ms ( 52.9%)
0:34.49 Type Merging: 6070 ms ( 35.1%)
0:34.49 Symbol Merging: 3067 ms ( 17.7%)
0:34.49 TPI Stream Layout: 596 ms ( 3.4%)
0:34.49 Globals Stream Layout: 322 ms ( 1.9%)
0:34.49 Commit to Disk: 2033 ms ( 11.7%)
0:34.49 Commit Output File: 52 ms ( 0.3%)
0:34.49 -------------------------------------------------
0:34.49 Total Link Time: 17316 ms (100.0%)

COFF-flavored lld collects timing stats about various phases of linking. This might be useful to have in logs. I left it off in developer builds to avoid spamming tight edit-compile cycles.

Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/23f5c0544d7b
Show linker time breakdown for xul.dll r=froydnj
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Assignee: nobody → dmajor
You need to log in before you can comment on or make changes to this bug.