[PATCH] D105506: [LLD] [COFF] Avoid thread exhaustion on 32-bit Windows host

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 6 12:38:14 PDT 2021


mstorsjo added a reviewer: pcc.
mstorsjo added a subscriber: pcc.
mstorsjo added a comment.

Adding @pcc who I think designed this performance optimization back in the day, in case he's still active and interested in commenting on it.

I think this might be a reasonably pragmatic fix for the issue. For the case we care most about, 64 bit, I don't think we would want to use a threadpool - using potentially unbounded number of threads might be pretty much intentional, to get as much parallelism as possible while waiting on IO. But for more limited cases like 32 bit mode, using a thread pool might be a reasonable approximation. This probably would be something of a performance degradation for 32 bit cases, while making it more robust - and spending more code on optimizing that case might not be worth it if it results in lots of code churn. But that depends on the scale of the degradation of course.

@jeremyd2019 - You wouldn't happen to have a reasonbly sized testcase to link lying around that you could try to run and see if the performance difference is measurable (i.e. a built project with e.g. lots of loose object files)? (Running lld often is so fast so it's hard to even measure anything unless you're linking something on the scale of Chromium, but I think this optimization is kinda vital.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105506



More information about the llvm-commits mailing list