Skip to content

feat: register profile command #3560

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

Merged

Conversation

maxveldink
Copy link
Contributor

@maxveldink maxveldink commented May 29, 2025

Motivation

Closes #2273
Requires this Vernier PR to ship and a new version to be released. ✅

This adds a way to profile the currently open file using Vernier, and display the output in editor (VSCode will also display numbers inline with the file).

Implementation

Registers a command that uses Vernier under the hood with the active file and open the .cpuprofile file.

Automated Tests

Since this was a straightforward command and I didn't see tests for similar commands, I opted to not add a test here. Happy to extract this to a function and test it if we'd prefer to do so.

Manual Tests

  1. Run the extension, using a project with a Ruby workspace that as a Ruby script that can be profiled.
  2. Run the Profile current file command (either from the palette or editor menu of active file)
  3. See a .cpuprofile open. When you click back to the profiled file, VSCode should automatically annotate lines with perf information.
ProfileCurrentFileDemo.mov

@maxveldink maxveldink force-pushed the 05-29-feat_register_profile_command branch 2 times, most recently from 91df651 to 7f1e21a Compare May 29, 2025 19:20
@Shopify Shopify deleted a comment from graphite-app bot May 29, 2025
@maxveldink maxveldink force-pushed the 05-29-feat_register_profile_command branch from 7f1e21a to 3efc9c6 Compare May 29, 2025 19:37
@maxveldink maxveldink force-pushed the 05-29-feat_register_profile_command branch from 3efc9c6 to 013151a Compare May 29, 2025 20:48
@maxveldink maxveldink added the enhancement New feature or request label May 30, 2025
@maxveldink maxveldink marked this pull request as ready for review May 30, 2025 16:21
@maxveldink maxveldink requested a review from a team as a code owner May 30, 2025 16:21
@maxveldink maxveldink force-pushed the 05-29-feat_register_profile_command branch from 45818da to 01070cd Compare May 30, 2025 16:21
@maxveldink maxveldink added the vscode This pull request should be included in the VS Code extension's release notes label May 30, 2025
@maxveldink maxveldink force-pushed the 05-29-feat_register_profile_command branch from 01070cd to 44f5123 Compare May 30, 2025 16:24
Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks!

@vinistock vinistock merged commit 19e925d into Shopify:main Jun 4, 2025
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add in-editor profiling with Vernier
2 participants