[PATCH] D96520: Reduce time spent parsing support files

Eric Leese via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 09:33:55 PST 2021


Eric added a comment.

I've updated the change to make the cacheing correct. I'm seeing the same query time improvement as with the faulty version. Updated profile:

  - 62.58% symbols_backend::WasmModule::GetSourceScripts[abi:cxx11]
     - 25.68% lldb_private::Module::GetCompileUnitAtIndex
        - 25.55% lldb_private::SymbolFile::GetCompileUnitAtIndex
           - 25.50% SymbolFileDWARF::ParseCompileUnitAtIndex
              - 24.72% SymbolFileDWARF::ParseCompileUnit
                 - 21.89% DWARFCompileUnit::GetNonSkeletonUnit
                      DWARFUnit::GetNonSkeletonUnit
                    + DWARFUnit::ExtractUnitDIEIfNeeded
                 + 0.99% DWARFUnit::GetPathStyle
                 + 0.72% lldb_private::FileSpec::FileSpec
                0.57% lldb_private::SymbolFile::AssertModuleLock
     - 22.88% lldb_private::CompileUnit::GetSupportFiles
        - 22.82% SymbolFileDWARF::ParseSupportFiles
           - 12.70% ParseSupportFilesFromPrologue
              + 5.29% std::map<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<cha
              + 1.94% lldb_private::FileSpec::FileSpec
              + 1.38% GetFileByIndex
              + 1.02% lldb_private::FileSpecList::EmplaceBack<lldb_private::FileSpec&>
                0.78% std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::
                0.64% llvm::DWARFDebugLine::Prologue::getIncludeDirectoryFromEntry
           - 9.34% ParseLLVMLineTablePrologue
              - 9.33% llvm::DWARFDebugLine::Prologue::parse
                 - 8.78% parseV2DirFileTables
                    + 4.21% llvm::DataExtractor::getULEB128
                    + 1.70% llvm::DataExtractor::getCStrRef
                    + 0.84% std::vector<llvm::DWARFDebugLine::FileNameEntry, std::allocator<llvm::DWARFDebugLine::FileNameEntry> >::push_back
     + 11.73% llvm::SmallSet<std::pair<llvm::StringRef, llvm::StringRef>, 1u, std::less<std::pair<llvm::StringRef, llvm::StringRef> > >::insert
     + 0.79% lldb_private::Module::GetNumCompileUnits
     + 0.76% lldb_private::ConstString::GetStringRef

As you can see ParseSupportFiles is substantially less expensive and the cacheing overhead is not high. The main remaining issue is loading all the non-skeleton units, which I hope to address in a future change but is proving to be trickier.


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

https://reviews.llvm.org/D96520



More information about the llvm-commits mailing list