[PATCH] D87469: [LLD][ELF] Optimize linker script filename glob pattern matching NFC

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 11:01:31 PDT 2020


andrewng added inline comments.


================
Comment at: lld/ELF/LinkerScript.cpp:436
 
-      std::string filename = getFilename(sec->file);
-      if (!cmd->filePat.match(filename) ||
----------------
MaskRay wrote:
> Is the string allocation the bottleneck?
Yes, that is a small part of the overhead. For inputs from archives there's also the string concatenation.

The main overhead is the repeated glob pattern matching for the same input file, i.e. any input file that contains a large number of sections.


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

https://reviews.llvm.org/D87469



More information about the llvm-commits mailing list