Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug adapter logging can cause high CPU when there's lots of VM Service traffic #4390

Closed
DanTup opened this issue Feb 14, 2023 · 0 comments
Closed
Labels
in debugger Relates to the debug adapter or process of launching a debug session is bug is performance
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Feb 14, 2023

Given an app that spawns isolates every half second:

void main() {
  runApp(const MyApp());
  Timer.periodic(const Duration(seconds: 1), (timer) async {
    final res = await Isolate.run(() => comp(100, 200));
  });
}

The CPU usage of the VS Code "window" process goes very high. It seems to be related to the volume of the dart.log events coming back from the debug adapter.

Right now, this logging is always enabled (so you can start logging after the debug session has started), but since this can negatively affect performance we should enable it only if logging is enabled as the debug session starts. If this becomes a problem, we should add the ability to send a custom message to the DA to start/stop logging later.

@DanTup DanTup added is bug in debugger Relates to the debug adapter or process of launching a debug session is performance labels Feb 14, 2023
@DanTup DanTup added this to the v3.60.0 milestone Feb 14, 2023
@DanTup DanTup closed this as completed in 167e43f Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session is bug is performance
Projects
None yet
Development

No branches or pull requests

1 participant