[Lldb-commits] [PATCH] D87675: [lldb/DWARF] Refactor to prefer emplace_back() vs. push_back()

Dmitry Antipov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 15 06:52:16 PDT 2020


dmantipov updated this revision to Diff 291894.
dmantipov added a comment.

OK let's reduce it to minimum minimorum.

As for the profiling, l can see possible improvement around DWARFAttributes::Append() - inlining even at -O2 and eliminating extra constructor call makes

  10.61%  intern-state     liblldb.so.12.0.0git   [.] DWARFDebugInfoEntry::GetAttributes
  7.28%  intern-state     liblldb.so.12.0.0git   [.] DWARFDebugInfoEntry::Extract
  6.88%  intern-state     liblldb.so.12.0.0git   [.] lldb_private::ManualDWARFIndex::IndexUnitImpl
  5.76%  intern-state     libpthread-2.31.so     [.] __pthread_rwlock_rdlock
  5.43%  intern-state     liblldb.so.12.0.0git   [.] lldb_private::DataExtractor::GetU32
  4.70%  intern-state     liblldb.so.12.0.0git   [.] DWARFUnit::GetDIE
  4.49%  intern-state     liblldb.so.12.0.0git   [.] lldb_private::DWARFContext::LoadOrGetSection
  4.37%  intern-state     libLLVM-12git.so       [.] llvm::StringMapImpl::FindKey
  3.50%  intern-state     liblldb.so.12.0.0git   [.] DWARFFormValue::GetFixedSize
  2.73%  intern-state     liblldb.so.12.0.0git   [.] DWARFUnit::ExtractDIEsRWLocked
  2.61%  intern-state     liblldb.so.12.0.0git   [.] Pool::GetConstCStringWithStringRef
  2.08%  intern-state     liblldb.so.12.0.0git   [.] lldb_private::DataExtractor::GetULEB128
  1.82%  intern-state     ld-2.31.so             [.] __tls_get_addr
  1.77%  intern-state     liblldb.so.12.0.0git   [.] std::__introsort_loop<__gnu_cxx::__normal_iterator<lldb_private::UniqueCStringMap<DIERef>::Entry*, std::vector<lldb_private::UniqueCStringMap<DIERef>::Entry, std::allocator<lldb_private::UniqueCStringMap<DIERef>::Entry> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<lldb_private::Uniqu
  eCStringMap<DIERef>::Compare> >
  1.60%  intern-state     liblldb.so.12.0.0git   [.] DWARFFormValue::ExtractValue
  1.55%  intern-state     libpthread-2.31.so     [.] __pthread_rwlock_unlock
  1.23%  intern-state     libc-2.31.so           [.] __strlen_avx2
  1.15%  intern-state     libc-2.31.so           [.] _int_free
  1.15%  intern-state     libc-2.31.so           [.] malloc
  1.14%  intern-state     liblldb.so.12.0.0git   [.] DWARFAttributes::ExtractFormValueAtIndex

from:

  7.68%  intern-state     liblldb.so.12.0.0git   [.] DWARFAttributes::Append
  7.25%  intern-state     liblldb.so.12.0.0git   [.] DWARFDebugInfoEntry::Extract
  6.34%  intern-state     liblldb.so.12.0.0git   [.] lldb_private::ManualDWARFIndex::IndexUnitImpl
  6.30%  intern-state     liblldb.so.12.0.0git   [.] DWARFDebugInfoEntry::GetAttributes
  5.55%  intern-state     libpthread-2.31.so     [.] __pthread_rwlock_rdlock
  5.51%  intern-state     liblldb.so.12.0.0git   [.] lldb_private::DataExtractor::GetU32
  4.50%  intern-state     liblldb.so.12.0.0git   [.] DWARFUnit::GetDIE
  4.34%  intern-state     liblldb.so.12.0.0git   [.] lldb_private::DWARFContext::LoadOrGetSection
  4.27%  intern-state     libLLVM-12git.so       [.] llvm::StringMapImpl::FindKey
  2.92%  intern-state     liblldb.so.12.0.0git   [.] DWARFFormValue::GetFixedSize
  2.65%  intern-state     liblldb.so.12.0.0git   [.] DWARFUnit::ExtractDIEsRWLocked
  2.51%  intern-state     liblldb.so.12.0.0git   [.] Pool::GetConstCStringWithStringRef
  1.93%  intern-state     liblldb.so.12.0.0git   [.] lldb_private::DataExtractor::GetULEB128
  1.79%  intern-state     liblldb.so.12.0.0git   [.] std::__introsort_loop<__gnu_cxx::__normal_iterator<lldb_private::UniqueCStringMap<DIERef>::Entry*, std::vector<lldb_private::UniqueCStringMap<DIERef>::Entry, std::allocator<lldb_private::UniqueCStringMap<DIERef>::Entry> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<lldb_private::UniqueCStringMap<DIERef>::Compare> >
  1.78%  intern-state     ld-2.31.so             [.] __tls_get_addr
  1.46%  intern-state     libpthread-2.31.so     [.] __pthread_rwlock_unlock
  1.45%  intern-state     liblldb.so.12.0.0git   [.] DWARFFormValue::ExtractValue
  1.22%  intern-state     libc-2.31.so           [.] __strlen_avx2
  1.16%  intern-state     libc-2.31.so           [.] malloc
  1.11%  intern-state     libc-2.31.so           [.] _int_free
  1.08%  intern-state     liblldb.so.12.0.0git   [.] DWARFAttributes::ExtractFormValueAtIndex

when loading symbols from clang + libLLVM.so (release build with '-O2 -g').


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

https://reviews.llvm.org/D87675

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87675.291894.patch
Type: text/x-patch
Size: 6560 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200915/3b66317f/attachment-0001.bin>


More information about the lldb-commits mailing list