[PATCH] D87805: [PDB] Merge types in parallel when using ghashing
Alexandre Ganea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 11 16:03:21 PST 2021
aganea added inline comments.
================
Comment at: lld/COFF/DebugTypes.cpp:621
+ size_t newSize = alignTo(ty.length(), 4);
+ merged.recs.resize(offset + newSize);
+ auto newRec = makeMutableArrayRef(&merged.recs[offset], newSize);
----------------
@rnk: Just to follow up on https://reviews.llvm.org/D94267#2491643, the `.resize()` here takes 3.5 sec out of 74 sec (cumulated thread time on 72 hyper-threads).
{F15003941}
I've modified the code to do instead two passes, then `.reserve()`, and that saves about 0.6 sec median walltime. Although I think it is better to wait on prefetching mmap'ed memory pages first.
```
Benchmark #1: before\lld-link.exe @link.rsp /threads:12
Time (mean ± σ): 17.939 s ± 1.215 s [User: 2.7 ms, System: 3.5 ms]
Range (min … max): 15.537 s … 18.597 s 10 runs
Benchmark #2: after\lld-link.exe @link.rsp /threads:12
Time (mean ± σ): 17.298 s ± 1.511 s [User: 1.4 ms, System: 8.9 ms]
Range (min … max): 15.512 s … 18.513 s 10 runs
```
As you see, there's also quite some variability in execution time, mostly because of the contention issues that I've mentionned in D94267.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87805/new/
https://reviews.llvm.org/D87805
More information about the llvm-commits
mailing list