[PATCH] D120658: [Dexter] Optimize breakpoint deletion in Visual Studio

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 28 04:50:30 PST 2022


StephenTozer created this revision.
StephenTozer added reviewers: Orlando, jmorse.
StephenTozer requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Breakpoint deletion in visual studio is currently implemented by iterating over the Dexter-assigned IDs of the breakpoints we want to delete, for each of which we iterate over the complete set of breakpoints in the debugger instance until we find the one we wish to delete. Ideally we would resolve this by directly deleting each breakpoint by some ID rather than searching through the full breakpoint list for them, but in the absence of such a feature in VS we can instead invert the loop to improve performance.

This patch changes breakpoint deletion to iterate over the complete list of breakpoints, deleting breakpoints that match the breakpoints we expect to delete by checking set membership. This represents a worst-case improvement from O(nm) to O(n), for 'm' breakpoints being deleted out of 'n' total. In practise this is almost exactly 'm'-times faster, as when we delete multiple breakpoints they are typically adjacent in the full breakpoint list.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120658

Files:
  cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerBase.py
  cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ConditionalController.py
  cross-project-tests/debuginfo-tests/dexter/dex/debugger/dbgeng/dbgeng.py
  cross-project-tests/debuginfo-tests/dexter/dex/debugger/lldb/LLDB.py
  cross-project-tests/debuginfo-tests/dexter/dex/debugger/visualstudio/VisualStudio.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120658.411791.patch
Type: text/x-patch
Size: 6044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220228/ac16401d/attachment.bin>


More information about the llvm-commits mailing list