<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/143642>143642</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lld: Avoid decompressing unused debug sections
</td>
</tr>
<tr>
<th>Labels</th>
<td>
lld
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pcc
</td>
</tr>
</table>
<pre>
When looking at a perf profile of a link with objects with compressed debug info and `-S` in ldflags, I noticed that a substantial amount of time was spent in `MergeInputSection::splitIntoPieces` -> `InputSectionBase::decompress`. This seems to be because the code that implements section stripping operates on `ctx.inputSections` while `splitSections` operates on `ctx.objectFiles`.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxskkFvnDAQhX-NuYwWeW0guwcOm7Yr5VCpUir1bOwB3BjbYoak_feV2UTZQ08Ieea958_PEPkpIvaifRTt18psPKe1z9ZWQ3J_-18zRggpvfg4gWEwkHEdIa9p9AEhjWAg-PgCb55nSMNvtEy3H5uWvCIROnA4bBP4OCYw0YHo5OFZdBJ8hODGYCYS6gs8QUzsLTrgebeibSA2kb0JYJa0RS6G7BeEN0NAGSMXDdHJ77hO-BTzxs9o2aco9EXoC-Xg-Sly-uHRIhXPg9Dfysb98KMhvC04_IgtOlnDz9kTEOJCwAkGhAGt2QiBZwSbHN6i-iUHXDByGd4VgXj1ORdqKeNqGAnSntTyn9rfee-h3uZCU3RyD3x_8p_tG-WrD_uF6sr12p312VTYHx-acye1blU1950Z9IMzp6OyjdTGNo1xw-nUmpO2-qEdKt8rqVrZHY9Stm2r6hGls92I9nzqxna0opG4GB_qEF6XOq1T5Yk27I-N7hpVBTNgoL06SoXghFKlQ2tfxg_DNpFoZPDE9CnAngP2ZVhf4PKafGnHB_OCa4vbZ2XeaVK1raGfmTOVZ1JXoa6T53kbapsWoa5F_v1zyGsqfIS67mFJqOt73tde_QsAAP__xp39Vg">