Added memory caching to lldb_private::Process. All lldb_private::Process
subclasses will automatically be able to take advantage of caching. The
cache line size is set to 512 by default.
This greatly speeds up stack backtraces on MacOSX when using the
ProcessGDBRemote process plug-in since only about 6300 packets per second
can be sent.
Initial speedups show:
Prior to caching: 10,000 stack frames took 5.2 seconds
After caching: 10,000 stack frames in 240 ms!
About a 20x speedup!
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@122996 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/Utility/UnwindLLDB.cpp b/source/Plugins/Process/Utility/UnwindLLDB.cpp
index 062d0a5..a1b030b 100644
--- a/source/Plugins/Process/Utility/UnwindLLDB.cpp
+++ b/source/Plugins/Process/Utility/UnwindLLDB.cpp
@@ -33,10 +33,24 @@
{
if (m_frames.empty())
{
+//#define DEBUG_FRAME_SPEED 1
+#if DEBUG_FRAME_SPEED
+ TimeValue time_value (TimeValue::Now());
+#endif
if (!AddFirstFrame ())
return 0;
while (AddOneMoreFrame ())
- ;
+ {
+#if DEBUG_FRAME_SPEED
+ if ((m_frames.size() % 10000) == 0)
+ {
+ TimeValue now(TimeValue::Now());
+ uint64_t delta_t = now - time_value;
+ printf ("10000 frames in %llu.%09llu ms\n", delta_t / NSEC_PER_SEC, delta_t % NSEC_PER_SEC);
+ time_value = now;
+ }
+#endif
+ }
}
return m_frames.size ();
}