[PATCH] D115416: [lld-macho] Prevent writing map files on the critical path

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 10:41:04 PST 2021


int3 added a comment.

@thakis I think they're orthogonal and equally useful improvements. One reason we haven't optimized the actual MapFile generation yet is that we're keeping it as ramp-up work for a new team member :)



================
Comment at: lld/MachO/Writer.cpp:68
 
+  ThreadPool writerThreadPool;
   std::unique_ptr<FileOutputBuffer> &buffer;
----------------
super nit, but "writer" here seems redundant since this is the only threadpool used in Writer


================
Comment at: lld/MachO/Writer.cpp:1153
+  writerThreadPool.async(writeMapFile);
   finalizeLinkEditSegment();
   writeOutputFile();
----------------
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.


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