This is an archive of the discontinued LLVM Phabricator instance.

[Dexter] Optimize breakpoint deletion in Visual Studio
ClosedPublic

Authored by StephenTozer on Feb 28 2022, 4:50 AM.

Details

Summary

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.

Diff Detail

Event Timeline

StephenTozer requested review of this revision.Feb 28 2022, 4:50 AM
StephenTozer created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2022, 4:50 AM
Orlando accepted this revision.Feb 28 2022, 5:11 AM

LGTM

This revision is now accepted and ready to land.Feb 28 2022, 5:11 AM
This revision was landed with ongoing or failed builds.Mar 1 2022, 5:14 AM
This revision was automatically updated to reflect the committed changes.