[Lldb-commits] [PATCH] D138878: [lldb] Remove timer from Module::GetNumCompileUnits

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 28 16:19:53 PST 2022


kastiglione created this revision.
kastiglione added reviewers: JDevlieghere, augusto2112.
Herald added a project: All.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

`GetNumCompileUnits` has fast execution, and is high firing. Fast and frequent functions are not good candidates for timers. In a recent profile, `GetNumCompileUnits` was called >>10k times with an average duration of 1 microsecond.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138878

Files:
  lldb/source/Core/Module.cpp


Index: lldb/source/Core/Module.cpp
===================================================================
--- lldb/source/Core/Module.cpp
+++ lldb/source/Core/Module.cpp
@@ -419,8 +419,6 @@
 
 size_t Module::GetNumCompileUnits() {
   std::lock_guard<std::recursive_mutex> guard(m_mutex);
-  LLDB_SCOPED_TIMERF("Module::GetNumCompileUnits (module = %p)",
-                     static_cast<void *>(this));
   if (SymbolFile *symbols = GetSymbolFile())
     return symbols->GetNumCompileUnits();
   return 0;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138878.478414.patch
Type: text/x-patch
Size: 503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221129/69af1365/attachment.bin>


More information about the lldb-commits mailing list