This is an archive of the discontinued LLVM Phabricator instance.

make BumpPtrAllocator's slab size growth speed configurable
AbandonedPublic

Authored by llunak on Oct 16 2019, 9:27 AM.

Details

Reviewers
chandlerc
Summary

The default of doubling the slab size only each 128 slabs seems very
conservative, at least for some use cases. If the allocator gets
asked for memory totalling 10MiB, it'll allocate 128*4096=0.5MiB
memory before it finally doubles the slab size, then will
allocate 128*8192=1MiB before doubling again, etc. A pathological
case is lldb's ConstString class, which uses a hashmap with 256
allocators, which means that when debugging a huge C++ project
the allocators will do thousands and thousands of small allocations
before they finally find out they need to allocate large amounts
of memory. See https://reviews.llvm.org/D68549 .

Diff Detail

Repository
rL LLVM

Event Timeline

llunak created this revision.Oct 16 2019, 9:27 AM

FYI: I opened D71654 with the same change + some tests and other minor fixes.

llunak abandoned this revision.Dec 20 2019, 5:19 AM

Closing, handled in D71654.