[PATCH] D62188: Speed up --start-lib and --end-lib.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 23:46:57 PDT 2019


MaskRay added a comment.

> Good point. I didn't think about that, but looks like that's a problem. I believe this can be fixed by inserting placeholder symbols first and then resolve them against LazyObject symbols. Let me try to do that.
> 
>> In LazyObjFile::parse():
>> 
>>   // Symbols[0,I) are inherited from LazyObjFile::parse(), other entries are nullptr.
>>   // This has another problem: it increases memory usage.
>>   // The copy assignment cannot be replaced with move assignment, because
>>   // parse() will continue processing Symbols[I+1] Symbols[I+2] ...
>>   File->Symbols = Symbols;
>>    
>> 
>> I think in most cases (that are not flagged by `--warn-backrefs`), this may not have a perceivable improvement in the current form. Actually,
>>  For an (input: 4.2G; output: 1.6G) executable, I measure a performance regression, 1% or lower, but the memory usage increases by ~1.6%. Do you know if the problem can be fixed?
> 
> What program did you use for your testing?

An internal indexing program. It was compiled with `-O3 -ffunction-sections -fdata-sections` and many other flags that shouldn't cause a big difference to the linker. I think the patch may show improvement after it is parallelized.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62188





More information about the llvm-commits mailing list