From 13278efd0c95a8b589bbd7dbbf17680a03b6eb77 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Mon, 6 Dec 2021 13:04:27 -0800 Subject: [PATCH] [lldb] Remove some trivial scoped timers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit While profiling lldb (from swift/llvm-project), these timers were noticed to be short lived and high firing, and so they add noise more than value. The data points I recorded are: `FindTypes_Impl`: 49,646 calls, 812ns avg, 40.33ms total `AppendSymbolIndexesWithName`: 36,229 calls, 913ns avg, 33.09ms total `FindAllSymbolsWithNameAndType`: 36,229 calls, 1.93µs avg, 70.05ms total `FindSymbolsWithNameAndType`: 23,263 calls, 3.09µs avg, 71.88ms total Differential Revision: https://reviews.llvm.org/D115182 --- lldb/source/Core/Module.cpp | 4 ---- lldb/source/Symbol/Symtab.cpp | 2 -- 2 files changed, 6 deletions(-) diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index cbecbb9..dbec825 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -940,7 +940,6 @@ void Module::FindTypes_Impl( size_t max_matches, llvm::DenseSet &searched_symbol_files, TypeMap &types) { - LLDB_SCOPED_TIMER(); if (SymbolFile *symbols = GetSymbolFile()) symbols->FindTypes(name, parent_decl_ctx, max_matches, searched_symbol_files, types); @@ -1346,9 +1345,6 @@ void Module::FindSymbolsWithNameAndType(ConstString name, SymbolContextList &sc_list) { // No need to protect this call using m_mutex all other method calls are // already thread safe. - LLDB_SCOPED_TIMERF( - "Module::FindSymbolsWithNameAndType (name = %s, type = %i)", - name.AsCString(), symbol_type); if (Symtab *symtab = GetSymtab()) { std::vector symbol_indexes; symtab->FindAllSymbolsWithNameAndType(name, symbol_type, symbol_indexes); diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp index c679555..0057b9e 100644 --- a/lldb/source/Symbol/Symtab.cpp +++ b/lldb/source/Symbol/Symtab.cpp @@ -663,7 +663,6 @@ uint32_t Symtab::AppendSymbolIndexesWithName(ConstString symbol_name, std::vector &indexes) { std::lock_guard guard(m_mutex); - LLDB_SCOPED_TIMER(); if (symbol_name) { if (!m_name_indexes_computed) InitNameIndexes(); @@ -808,7 +807,6 @@ Symtab::FindAllSymbolsWithNameAndType(ConstString name, std::vector &symbol_indexes) { std::lock_guard guard(m_mutex); - LLDB_SCOPED_TIMER(); // Initialize all of the lookup by name indexes before converting NAME to a // uniqued string NAME_STR below. if (!m_name_indexes_computed) -- 2.7.4