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

Support for capturing heap and tracing-API-based profiles #435

Closed
connor4312 opened this issue Apr 15, 2020 · 4 comments
Closed

Support for capturing heap and tracing-API-based profiles #435

connor4312 opened this issue Apr 15, 2020 · 4 comments
Assignees
Labels
feature-request Request for new features or functionality gracehopperOSD hacktoberfest
Milestone

Comments

@connor4312
Copy link
Member

connor4312 commented Apr 15, 2020

Right now we can capture CPU profiles. We should also support heap profiles for all targets, and can consider supporting tracing API-based profiling for browsers.

@jasonwilliams
Copy link
Contributor

This is exciting.
I suppose there needs to be an option to start and stop right?
So we can pick and choose which bits we want to capture

@connor4312 connor4312 modified the milestones: May 2020, June 2020 Jun 2, 2020
@connor4312 connor4312 modified the milestones: June 2020, July 2020 Jul 1, 2020
@connor4312 connor4312 modified the milestones: July 2020, August 2020 Aug 6, 2020
@connor4312 connor4312 modified the milestones: August 2020, September 2020 Sep 8, 2020
@connor4312
Copy link
Member Author

connor4312 commented Oct 1, 2020

This issue is a good one for Grace Hopper / Hacktoberfest!

Collecting a heap profile here should be possible with plug-ins to our existing functionality. The "Chrome Debug Protocol" is how we talk to the debuggee (Node.js, or browsers). CDP docs for heap profiling here -- you'll probably want to look at the sampling heap profile initially.

You want to create a new IProfiler class here and bind it in the IOC container. The interfaces should guide you through what's needed. You'll probably want to abstract and reuse some of the location-massaging code from the CpuProfiler.

Once it's there, the "Start Profiling" command (available when running a Node.js program) will open a picker asking you what kind of profile you want to take.

Additional extra things you could do once you have that working:

  • Currently, profiling is duration based, but users could also want to take point-in-time snapshots of their heap. You can add support for this, which will involve some changes in the ui side of things since there's no 'termination condition'
  • You can add support for viewing the resulting heap profile files to the visualizer: https://github.com/microsoft/vscode-js-profile-visualizer

General contributing/setup: https://github.com/microsoft/vscode-js-debug/blob/master/CONTRIBUTING.md#development

@timjensen-kr
Copy link

timjensen-kr commented Mar 4, 2021

@connor4312 Any idea when this might get added? We would love to use this functionality

@connor4312
Copy link
Member Author

connor4312 commented Dec 6, 2022

We had a contribution to add heap profiling. Currently no plans to add a tracing profiler to VS Code. This is not supported by V8/Node.js anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality gracehopperOSD hacktoberfest
Projects
None yet
Development

No branches or pull requests

3 participants