[PATCH] D71654: [llvm] Add a way to speed up the speed in which BumpPtrAllocator increases slab sizes

Raphael Isemann via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 04:12:01 PST 2019


teemperor created this revision.
teemperor added reviewers: george.karpenkov, dergachev.a, chandlerc.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In D68549 <https://reviews.llvm.org/D68549> we noticed that our BumpPtrAllocator we use for LLDB's ConstString implementation is growing its slabs at
a rate that is too slow for our use case. It causes that we spend a lot of time calling `malloc` for all the tiny slabs that our
ConstString BumpPtrAllocators create. We also can't just increase the slab size in the ConstString implementation
(which is what D68549 <https://reviews.llvm.org/D68549> originally did) as this really increased the amount of (mostly unused) allocated memory
in any process using ConstString.

This patch adds a template argument for the BumpPtrAllocatorImpl that allows specifying a faster rate at which the
BumpPtrAllocator increases the slab size. This allows LLDB to specify a faster rate at which the slabs grow which
should keep both memory consumption and time spent calling malloc low.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71654

Files:
  llvm/include/llvm/Support/Allocator.h
  llvm/unittests/Support/AllocatorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71654.234500.patch
Type: text/x-patch
Size: 5746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191218/3c2045a0/attachment.bin>


More information about the llvm-commits mailing list