[PATCH] D115416: [lld-macho] Prevent writing map files on the critical path
Vincent Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 13 11:04:06 PST 2021
thevinster added inline comments.
================
Comment at: lld/MachO/Writer.cpp:68
+ ThreadPool writerThreadPool;
std::unique_ptr<FileOutputBuffer> &buffer;
----------------
int3 wrote:
> super nit, but "writer" here seems redundant since this is the only threadpool used in Writer
I think it might be more relevant now we that want to use it in `finalizeLinkEditSegment`. Any reason why we want to instantiate it in the `run` scope as opposed to having it as a member of the class? It's possible we may want to use it elsewhere within the `Writer` class? In fact, scanning usages of `parallelForEach{N}` also shows `writeUuid` benefiting from using async as well. In that case, it makes sense to put it at the class level scope.
================
Comment at: lld/MachO/Writer.cpp:1153
+ writerThreadPool.async(writeMapFile);
finalizeLinkEditSegment();
writeOutputFile();
----------------
int3 wrote:
> so as my earlier block comment was saying, we should pass `writerThreadPool` to `finalizeLinkEditSegment` too and use that in lieu of `parallelForEachN`, so that we maintain control of the total number of threads.
Oh I see. It wasn't clear from your previous comment that you wanted to replace `parallelForEachN` with it. I'll change.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115416/new/
https://reviews.llvm.org/D115416
More information about the llvm-commits
mailing list