[Lldb-commits] [lldb] 13278ef - [lldb] Remove some trivial scoped timers
Dave Lee via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 6 15:22:42 PST 2021
Author: Dave Lee
Date: 2021-12-06T15:22:28-08:00
New Revision: 13278efd0c95a8b589bbd7dbbf17680a03b6eb77
URL: https://github.com/llvm/llvm-project/commit/13278efd0c95a8b589bbd7dbbf17680a03b6eb77
DIFF: https://github.com/llvm/llvm-project/commit/13278efd0c95a8b589bbd7dbbf17680a03b6eb77.diff
LOG: [lldb] Remove some trivial scoped timers
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
Added:
Modified:
lldb/source/Core/Module.cpp
lldb/source/Symbol/Symtab.cpp
Removed:
################################################################################
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index cbecbb9aa5fed..dbec8250223cf 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<lldb_private::SymbolFile *> &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<uint32_t> symbol_indexes;
symtab->FindAllSymbolsWithNameAndType(name, symbol_type, symbol_indexes);
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp
index c67955523bfb1..0057b9e6c8fb2 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<uint32_t> &indexes) {
std::lock_guard<std::recursive_mutex> 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<uint32_t> &symbol_indexes) {
std::lock_guard<std::recursive_mutex> 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)
More information about the lldb-commits
mailing list