llvm-project/lldb/source/Core
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
..
Address.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
AddressRange.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
AddressResolver.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
AddressResolverFileLine.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
CMakeLists.txt [lldb/Core] Add SourceLocationSpec class (NFC) 2021-05-04 16:34:45 +00:00
Communication.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
CoreProperties.td [lldb] Document ctrl-f for completing show-autosuggestion 2021-05-17 12:52:20 -07:00
Debugger.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
Declaration.cpp [lldb] Move and clean-up the Declaration class (NFC) 2021-05-04 16:34:44 +00:00
Disassembler.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
DumpDataExtractor.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
DumpRegisterValue.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
DynamicLoader.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
EmulateInstruction.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
FileLineResolver.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FileSpecList.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
FormatEntity.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
Highlighter.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
IOHandler.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
IOHandlerCursesGUI.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
Mangled.cpp [lldb][NFC] Use Language plugins in Mangled::GuessLanguage 2021-06-01 18:02:07 +02:00
Module.cpp Improve performance when parsing symbol tables in mach-o files. 2021-06-02 10:31:37 -07:00
ModuleChild.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ModuleList.cpp [lldb] Access the ModuleList through iterators where possible (NFC) 2021-01-07 21:06:36 -08:00
Opcode.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
PluginManager.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
Progress.cpp Add a progress class that can track long running operations in LLDB. 2021-03-24 12:58:13 -07:00
RichManglingContext.cpp [lldb] Fix RichManglingContext::FromCxxMethodName() leak 2021-04-21 12:32:08 -07:00
SearchFilter.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
Section.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
SourceLocationSpec.cpp [lldb/Core] Add SourceLocationSpec class (NFC) 2021-05-04 16:34:45 +00:00
SourceManager.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
StreamAsynchronousIO.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
StreamFile.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
UserSettingsController.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Value.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
ValueObject.cpp [lldb] Fix typos. NFC. 2021-05-31 06:48:57 +07:00
ValueObjectCast.cpp Unify the return value of GetByteSize to an llvm::Optional<uint64_t> (NFC-ish) 2020-07-27 13:26:35 -07:00
ValueObjectChild.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
ValueObjectConstResult.cpp Make the error condition in Value::ValueType explicit (NFC) 2021-02-12 16:12:31 -08:00
ValueObjectConstResultCast.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ValueObjectConstResultChild.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ValueObjectConstResultImpl.cpp Make the error condition in Value::ValueType explicit (NFC) 2021-02-12 16:12:31 -08:00
ValueObjectDynamicValue.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
ValueObjectList.cpp [lldb] Delete the SharingPtr class 2020-02-11 13:23:18 +01:00
ValueObjectMemory.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
ValueObjectRegister.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
ValueObjectSyntheticFilter.cpp [lldb][NFC] Cleanup ValueObject construction code 2021-02-23 09:39:18 +01:00
ValueObjectUpdater.cpp [lldb][NFC] Rename the second ValueObjectManager to ValueObjectUpdater and remove the dead code 2021-02-24 13:58:01 +01:00
ValueObjectVariable.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00