[PATCH] D113153: [lld-macho] Cache readFile results

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 09:45:44 PDT 2021


keith added a comment.

In D113153#3108083 <https://reviews.llvm.org/D113153#3108083>, @smeenai wrote:

> This one needs to be reset in the `cleanupCallback` as well (https://github.com/llvm/llvm-project/blob/e7fdff403e849b18d93cd4a5cb760cba66a92c0b/lld/MachO/Driver.cpp#L1098), as do all the other caches you added (if they aren't already). The cache itself would technically be valid, but we free all our memory arenas at the end of a linker run, so the entries would point to freed memory.

Ah thanks, I wondered but should have asked. https://reviews.llvm.org/D113198

> Out of curiosity, is the link that takes 8 seconds now the same one that ld64 takes 20 seconds for? If not, I'd be curious to know how the speed for that one compares after all your changes.

Yes, so for the same link our benchmarks have been:

- lld before my changes: 1 minute 45 seconds
- ld64 20s
- zld (optimized ld64 fork) ~13s
- lld with all my changes ~8s

Unfortunately the produced binary crashes on what appears to be issues with dropped Objective-C categories, I'm working on reducing a repro case, but if there are known issues around this (I couldn't find any on the bug tracker) I would love to know!

> Thanks for all the fixes!

Thanks for the reviews!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113153/new/

https://reviews.llvm.org/D113153



More information about the llvm-commits mailing list