[llvm] [Object][Archive][NFC] Create all symbolic files objects before calculating offsets. (PR #85229)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 01:15:00 PDT 2024


jh7370 wrote:

> > Taking a look at the change, I'm a little concerned about the potential impact on memory usage of this version of the PR. Previously, the code would only need one symbolic file to be in memory at a time, but now it requires all of them. I don't have any numbers, but I wouldn't be surprised in a large archive with many members with lots of symbols (not an unusual thing) if this change has drastically increased memory usage. I think it would be a good idea to do some performance analysis of the before and after of this change for particularly large archives.
> 
> Please note that symbolic file is stored in `MemberData` struct, which is returned by `computeMemberData`. `CurSymFile` is not destructed in the loop, it's moved to `Ret` vector instead, so we store all of them in memory with or without this patch. The memory usage impact of this PR is just one additional vector of pointers.

Oh, you're right. I looked through this code at least 3 times before posting my comment, looking for anything like this and still didn't see it. Sorry for the noise.

https://github.com/llvm/llvm-project/pull/85229


More information about the llvm-commits mailing list