summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-10-17 00:02:32 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-10-17 00:02:32 +0000
commit528b1b64310b327876b516113b237a62f9e90728 (patch)
treecaeb65fbfd5338c9063c5999ceba4d1b0404e23d
parentedd52d48a421ab59a48e65151373c2dd4ba9e10e (diff)
Revert "make ConstString allocate memory in non-tiny chunks"
As discussed in https://reviews.llvm.org/D68549, the actual issue here seems to be that the BumpPtrAllocator is growing far too slow because of the 256 different StringPools used as the backend for ConstString. At the same time the original patch made ConstString allocate memory in 256MiB slabs for the same reason, meaning that the RSS usage of LLDB increased by a few hundred MiB for all users without bringing any noticeable speedup for most of them. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@375062 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--source/Utility/ConstString.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/Utility/ConstString.cpp b/source/Utility/ConstString.cpp
index 238fd7bdd..2516ecf6a 100644
--- a/source/Utility/ConstString.cpp
+++ b/source/Utility/ConstString.cpp
@@ -31,10 +31,7 @@ using namespace lldb_private;
class Pool {
public:
typedef const char *StringPoolValueType;
- // BumpPtrAllocator allocates in 4KiB chunks, any larger C++ project is going
- // to have megabytes of symbols, so allocate in larger chunks.
- typedef llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 1048576> Allocator;
- typedef llvm::StringMap<StringPoolValueType, Allocator>
+ typedef llvm::StringMap<StringPoolValueType, llvm::BumpPtrAllocator>
StringPool;
typedef llvm::StringMapEntry<StringPoolValueType> StringPoolEntryType;
@@ -155,9 +152,7 @@ protected:
struct PoolEntry {
mutable llvm::sys::SmartRWMutex<false> m_mutex;
- // StringMap by default starts with 16 buckets, any larger project is
- // going to have many symbols, so start with a larger value.
- StringPool m_string_map = StringPool( 65536 );
+ StringPool m_string_map;
};
std::array<PoolEntry, 256> m_string_pools;