[PATCH] D45003: [Support] Make line-number cache robust against access patterns.

Graydon Hoare via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 18:31:48 PDT 2018


graydon added a comment.

In https://reviews.llvm.org/D45003#1051045, @jordan_rose wrote:

> That's potentially a lot more memory usage, since the various vectors never get freed. Have you measured what the effect on memory usage is on a large Swift project with diagnostics in many files?


I've not been able to measure any memory difference when building local projects here (rusage maxrss fluctuates a few tens of kb anyways due to goodness knows what nondeterminism). Keep in mind we only fill the vector on a lookup, so most buffers will never be populated. And those that do, assume a file is (say) 1000 lines long, it'll cost 8kb to index. Even if we indexed a thousand such files -- a diagnostic in every file of a large project! -- we'd only be talking 8mb.

I'll keep trying a few other cases and post back.


Repository:
  rL LLVM

https://reviews.llvm.org/D45003





More information about the llvm-commits mailing list