[Lldb-commits] [PATCH] D68549: make ConstString allocate memory in non-tiny chunks

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 16 01:34:01 PDT 2019


labath added a comment.

Yeah, allocating 256MB sounds a bit too much, particularly for lldb-server (ideally, I'd remove ConstString from lldb-server completely, but that's a different story). The reason for 256 string pools was to avoid/reduce locking contention when accessing the pool, but that does make the power-of-2 scaling in BumpPtrAllocator kick in too slowly.

Maybe we could reduce the initial size by an order of magnitude here? Allocating 25MB (or whatever is the closest power of 2) does not sound like too much, and it should still be much better than 4kb. As an alternative, we could make the scaling in BumpPtrAllocator faster/configurable. I also doubt that the number of string pools was arrived at very scientifically, so it may be possible to tune that number too (though, without any data back it up, it seems to me that reducing the slab size should have less impact than reducing the pool count).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68549





More information about the lldb-commits mailing list