[Lldb-commits] [PATCH] D118814: [lldb] Don't keep demangled names in memory after indexing

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 2 09:59:04 PST 2022


JDevlieghere created this revision.
JDevlieghere added reviewers: jingham, clayborg, labath.
Herald added a subscriber: arphaman.
JDevlieghere requested review of this revision.

The symbol table needs to demangle all symbols when building its index. However, the index doesn't need the demangeld symbols after it's done. We keep the demangled symbols in memory for caching purposes, so that if we do need to demangle them again. Most of the time you don't need (all) the demangled symbols again.

This patch add a setting to prefer using less memory over p and not cache all the demangled strings that are generated for indexing. If the symbol does get demangled later on, it is cached as usual. This change only impacts the batch demangled operation when building the symbol table index.

I was going to keep this setting default to "on" to keep the existing behavior, but Jim argued that the amount of memory we save here is well worth the small performance hit of having to demangle a subset of symbols twice.


https://reviews.llvm.org/D118814

Files:
  lldb/include/lldb/Core/Mangled.h
  lldb/include/lldb/Core/ModuleList.h
  lldb/source/Core/CoreProperties.td
  lldb/source/Core/Mangled.cpp
  lldb/source/Core/ModuleList.cpp
  lldb/source/Symbol/Symtab.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118814.405325.patch
Type: text/x-patch
Size: 5695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220202/38def321/attachment-0001.bin>


More information about the lldb-commits mailing list