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

feat: initial work on profiling #392

Merged
merged 1 commit into from
Mar 13, 2020
Merged

feat: initial work on profiling #392

merged 1 commit into from
Mar 13, 2020

Conversation

connor4312
Copy link
Member

This PR implements basic .cpuprofile capturing for debug sessions.

  • Users can start profiling through a context menu on the debug session,
    or by running a command from the palette. If there's more than one
    session, running a command will open a quickpick to choose the session
    to profile.
  • They will then be asked what kind of profile they want to record. For
    Node.js this will be .cpuprofiles and .heapprofiles. For browsers, it
    will allow the newer trace profiles.
  • While profiling, the debugger is disabled, like the chrome devtools
    does. This removes performance overhead and the ability to hit
    breakpoints, which mess with the profile...
  • Profiling state is shown in the status bar, and clicking on the entry
    will stop profiling and ask the user where they want to save the profile
    file. There's also a 'stop profiling' command.

This should give us a good foundation for further types and profiling
mechanics in the future.

I'm not totally happy with the entry and exitpoints as-is. You have to
know it's there to be able to start profiling, and then it's kind of
hard to figure out how to stop profiling. The chrome devtools shows an
overlay while profiling, which prevents the user try to e.g. set
breakpoints or use the REPL, implicitly communicating that debugging is
not possible in this state. I'm not sure what the best solution for us
is.

https://memes.peet.io/img/20-03-1ac56131-ddd4-47f7-9eb1-10644db126f4.webm

cc @roblourens @ididorn for thoughts. Will also bring this/whatever we
discuss up in next week's UX sync.

This PR implements basic .cpuprofile capturing for debug sessions.

- Users can start profiling through a context menu on the debug session,
or by running a command from the palette. If there's more than one
session, running a command will open a quickpick to choose the session
to profile.
- They will then be asked what kind of profile they want to record. For
Node.js this will be .cpuprofiles and .heapprofiles. For browsers, it
will allow the newer trace profiles.
- While profiling, the debugger is disabled, like the chrome devtools
does. This removes performance overhead and the ability to hit
breakpoints, which mess with the profile...
- Profiling state is shown in the status bar, and clicking on the entry
will stop profiling and ask the user where they want to save the profile
file. There's also a 'stop profiling' command.

This should give us a good foundation for further types and profiling
mechanics in the future.

I'm not totally happy with the entry and exitpoints as-is. You have to
know it's there to be able to start profiling, and then it's kind of
hard to figure out how to stop profiling. The chrome devtools shows an
overlay while profiling, which prevents the user try to e.g. set
breakpoints or use the REPL, implicitly communicating that debugging is
not possible in this state. I'm not sure what the best solution for us
is.

cc @roblourens @ididorn for thoughts. Will also bring this/whatever we
discuss up in next week's UX sync.
@connor4312 connor4312 merged commit 8b680f1 into master Mar 13, 2020
@connor4312 connor4312 deleted the feat/profiling-init branch March 13, 2020 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant