[Lldb-commits] [PATCH] D149214: [lldb] Speed up DebugAbbrev parsing

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 26 15:42:47 PDT 2023


bulbazord added a comment.

In D149214#4300491 <https://reviews.llvm.org/D149214#4300491>, @aprantl wrote:

> Did you also measure the extra memory consumption? I would be surprised if this mattered, but we do parse a lot of DWARF DIEs...
>
> Generally this seems fine.

I compared the memory profile before/after this change. The summary is that we consume about 50% more memory on average (283mb vs 425mb) but our total number of allocations is down by over half. This makes sense because the size of `DWARFAbbreviationDeclaration` now includes the size of 8 `DWARFAttribute`s, so when we create the `DWARFAbbreviationDeclaration` and copy it into the `DWARFAbbreviationDeclarationSet`'s vector, we're going to allocate more memory to hold each one. However, most `DWARFAbbreviationDeclaration`s probably don't use all 8 slots of the `SmallVector` on average, so maybe we could tune this number further to reduce overall memory consumptions?

For what it's worth, llvm's version of `DWARFAbbreviationDeclaration` also stores attributes in a `SmallVector<$attribute_type, 8>` as well, so we're not doing any worse than LLVM in this regard.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149214



More information about the lldb-commits mailing list