llvm-project/lldb/source/Symbol
Greg Clayton b0572abf72 Improve performance when parsing symbol tables in mach-o files.
Some larger projects were loading quite slowly with the current LLDB on macOS and macOS simulator builds. I did some instrument traces and found 3 main culprits:
- a LLDB timer that was put into a function that was called too often
- a std::set that was keeping track of the address of symbols that were already added
- a unnamed function generator in ObjectFile that was going slow due to allocations

In order to see this in action I ran the latest LLDB on a large application with many frameworks using the following method:

(lldb) script import time; start_time = time.perf_counter()
(lldb) file Large.app
(lldb) script print(time.perf_counter() - start_time)

I first range "sudo purge" to clear the system file caches to simulate a cold startup of the debugger, followed by two iterations with warm file caches.

Prior to this fix I was seeing the following timings:

17.68 (cold)
14.56 (warm 1)
14.52 (warm 2)

After this fix I was seeing:

11.32 (cold)
8.43 (warm 1)
8.49 (warm 2)

Differential Revision: https://reviews.llvm.org/D103504
2021-06-02 10:31:37 -07:00
..
ArmUnwindInfo.cpp [lldb] NFC: Fix trivial typo in comments, documents, and messages 2020-04-07 01:06:16 +09:00
Block.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CMakeLists.txt [lldb] Move and clean-up the Declaration class (NFC) 2021-05-04 16:34:44 +00:00
CompactUnwindInfo.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CompileUnit.cpp [lldb] Refactor argument group by SourceLocationSpec (NFCI) 2021-05-04 23:04:31 +00:00
CompilerDecl.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CompilerDeclContext.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CompilerType.cpp [lldb][NFC] Give CompilerType's IsArrayType/IsVectorType/IsBlockPointerType out-parameters default values 2021-02-23 11:15:31 +01:00
DWARFCallFrameInfo.cpp [lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC) 2020-12-22 09:10:27 -08:00
DebugMacros.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
DeclVendor.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FuncUnwinders.cpp [lldb][NFC] Add 'override' where missing in source/ and tools/ 2020-07-15 11:34:47 -07:00
Function.cpp Target::ReadMemory read from read-only binary file Section, not memory 2021-04-16 16:13:07 -07:00
LineEntry.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LineTable.cpp [lldb/Symbol] Fix column breakpoint `move_to_nearest_code` match 2021-05-05 05:07:50 +00:00
LocateSymbolFile.cpp [lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC) 2020-12-22 09:10:27 -08:00
LocateSymbolFileMacOSX.cpp Ignore DBGArchitecture from dsymForUUID's plist 2020-12-09 14:19:55 -08:00
ObjectFile.cpp Improve performance when parsing symbol tables in mach-o files. 2021-06-02 10:31:37 -07:00
PostfixExpression.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Symbol.cpp Target::ReadMemory read from read-only binary file Section, not memory 2021-04-16 16:13:07 -07:00
SymbolContext.cpp Fix "image lookup --address" Summary results for inline functions. 2021-04-01 11:36:26 -07:00
SymbolFile.cpp [lldb] Refactor argument group by SourceLocationSpec (NFCI) 2021-05-04 23:04:31 +00:00
SymbolVendor.cpp [lldb] Delete copy operations on PluginInterface class 2020-10-09 10:37:09 +02:00
Symtab.cpp [lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC) 2020-12-22 09:10:27 -08:00
Type.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
TypeList.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TypeMap.cpp Allow lldb-test to combine -find with -dump-clang-ast 2020-04-17 11:01:20 -07:00
TypeSystem.cpp [lldb] Fix use of undefined type 'lldb_private::UtilityFunction' 2020-10-23 11:48:11 -07:00
UnwindPlan.cpp Add a new Row setting to mark all un-declared regs as Undefined 2021-02-17 23:52:28 -08:00
UnwindTable.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
Variable.cpp Move initialization of Variable::m_loc_is_const_data into constructor (NFC) 2020-10-13 17:01:28 -07:00
VariableList.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00