Skip to content

Commit 6de5707

Browse files
committed
[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 (cherry picked from commit 13278ef)
1 parent 7c83cf7 commit 6de5707

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

lldb/source/Core/Module.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,6 @@ void Module::FindTypes_Impl(
970970
size_t max_matches,
971971
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
972972
TypeMap &types) {
973-
LLDB_SCOPED_TIMER();
974973
if (SymbolFile *symbols = GetSymbolFile())
975974
symbols->FindTypes(name, parent_decl_ctx, max_matches,
976975
searched_symbol_files, types);
@@ -1376,9 +1375,6 @@ void Module::FindSymbolsWithNameAndType(ConstString name,
13761375
SymbolContextList &sc_list) {
13771376
// No need to protect this call using m_mutex all other method calls are
13781377
// already thread safe.
1379-
LLDB_SCOPED_TIMERF(
1380-
"Module::FindSymbolsWithNameAndType (name = %s, type = %i)",
1381-
name.AsCString(), symbol_type);
13821378
if (Symtab *symtab = GetSymtab()) {
13831379
std::vector<uint32_t> symbol_indexes;
13841380
symtab->FindAllSymbolsWithNameAndType(name, symbol_type, symbol_indexes);

lldb/source/Symbol/Symtab.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,6 @@ uint32_t Symtab::AppendSymbolIndexesWithName(ConstString symbol_name,
659659
std::vector<uint32_t> &indexes) {
660660
std::lock_guard<std::recursive_mutex> guard(m_mutex);
661661

662-
LLDB_SCOPED_TIMER();
663662
if (symbol_name) {
664663
if (!m_name_indexes_computed)
665664
InitNameIndexes();
@@ -806,7 +805,6 @@ Symtab::FindAllSymbolsWithNameAndType(ConstString name,
806805
std::vector<uint32_t> &symbol_indexes) {
807806
std::lock_guard<std::recursive_mutex> guard(m_mutex);
808807

809-
LLDB_SCOPED_TIMER();
810808
// Initialize all of the lookup by name indexes before converting NAME to a
811809
// uniqued string NAME_STR below.
812810
if (!m_name_indexes_computed)

0 commit comments

Comments
 (0)