This is an archive of the discontinued LLVM Phabricator instance.

[lldb-vscode] Reduce chattiness of progress events
ClosedPublic

Authored by wallace on Apr 13 2021, 9:50 PM.

Details

Summary

Progress events internally have a completed count and a total count, which can mean that for a job with 20000 total counts, then there will be 20000 events fired. Sending all these events to the IDE can break it. For example, debugging a huge binary resulted in around 50 million messages, which rendered the IDE useless, as it was spending all of its resources simply parsing messages and updating the UI.

A way to fix this is to send unique percentage updates, which are at most 100 per job, which is not much. I was able to debug that big target and confirm that only unique percentage notifications are sent. I can't write a test for this because the current test is flaky. I'll figure out later how to make the test reliable, but fixing this will unblock us from deploy a new version of lldb-vscode.

These are the unique progress events in the logs

The progress UI in VSCode looks like this

Diff Detail

Event Timeline

wallace created this revision.Apr 13 2021, 9:50 PM
wallace requested review of this revision.Apr 13 2021, 9:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2021, 9:50 PM
wallace edited the summary of this revision. (Show Details)Apr 13 2021, 9:52 PM
wallace added reviewers: kusmour, yinghuitan.
wallace added inline comments.Apr 13 2021, 10:01 PM
lldb/tools/lldb-vscode/ProgressEvent.cpp
39–79

all of this is just moved from the existing code

kusmour accepted this revision.Apr 14 2021, 12:35 PM
This revision is now accepted and ready to land.Apr 14 2021, 12:35 PM
This revision was landed with ongoing or failed builds.Apr 14 2021, 1:00 PM
This revision was automatically updated to reflect the committed changes.