Replies: 18 comments 37 replies
-
@joyeecheung @mhdawson @mcollina @jasnell @gireeshpunathil @Qard FYI |
Beta Was this translation helpful? Give feedback.
3 replies
-
@joyeecheung @mhdawson @mcollina @jasnell @gireeshpunathil @Qard FYI |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Author: Nancy Li (@lilysjtu2011), Jecelyn Yeen (@jecfish)
Posted: Nov 9, 2022
Status: Complete
Chrome bug tracker: https://crbug.com/1354548
The goal of this RFC is to validate the design with the community, solicit feedback on open questions, and enable experimentation via a non-production-ready prototype included in this proposal.
Complete: This RFC is now complete. See a summary #2 (comment).
Motivation #
Since Chrome 58, the DevTools team set a long-term goal to deprecate the JavaScript Profiler (Profiler tab), and migrate Node.js and Deno developers to use Performance panel for profiling JavaScript CPU performance.
These changes allow users to profile performance consistently with one single entry point - the Performance panel.
Goals #
Profile Node.js / Deno JavaScript CPU performance with Performance panel
Minimize impact on the ecosystem
Current state #
Here is the current workflow on profiling JavaScript CPU performance:
Run
node --inspect file-name.js
ordeno --inspect file-name.js
(e.g. use this example file)Open DevTools for Node via one of these options:
chrome://inspect
> Devices > click Open dedicated DevTools for Nodechrome://inspect
> Remote target > click InspectStart and end profiling by clicking the

Record
button in the Profiler tab.View the result in the Profiler tab. Use the dropdown to switch to different views. It support 3 modes currently :
Chart



Heavy (bottom up)
Tree (top down)
Try the prototype: Profile using the Performance panel #
There is a prototype implementation. Below, we show a guide for trying it out. This is a draft implementation, with missing features and non-final design aspects.
Please use Chrome Canary to play with the prototype.
Profiling with the Record button
Run
node --inspect file-name.js
ordeno --inspect file-name.js
Open DevTools for Node. (Chrome Canary)
Open the Performance panel via the 3-dot menu > More tools > Performance panel. This step is not required once the changes are rolled out officially, the Performance panel will show by default.

Start and end profiling by clicking the

Record
button in the Performance panel.View the result in the Performance panel. The UI is different from the Profiler tab but you can find all the information:
Chart



Bottom-up
Call tree
Profiling with the console.profile() command
If you profile performance with the
console.profile()
command, you need to enable an experiment to map the result to the Performance panel.node --inspect file-name.js
ordeno --inspect file-name.js
(e.g. use this example file)FAQ #
What will happen with the Profiler tab in the future? Will that be deprecated / removed?
Yes, we plan to deprecate the Profiler tab by stages. We will look into community feedback, and implement the JavaScript profiling capability into the Performance panel before deprecation.
Can I load the CPU profile I saved in the Profiler tab previously into the Performance panel?
Yes. You can import
.cpuprofile
files to the Performance panel.Are both Profiler tab and Performance panel using the same data source?
Yes. The backend data source is the same for both. However, there are frontend logics that change the displayed data in the Profiler tab.
Below are the same profiling results shown in the Profiler tab and Performance panel.
There are
31 known differences at the moment:a. From showing frames directly to organizing them under call stack - In the above example, the Profiler shows
executeUserEntryPoint
and theModule
frames straight away. On the other hand, the Performance panel organizes them under the same call stack, you need to expand them to view it.b.
crbug.com/1382733 (Fixed) - Some frames like(garbage collector)
are hidden now in the Performance panel. We are working on adding them.c.
crbug.com/1080918 (Fixed) - Differences in profilingsetTimeout
call due to the stack trace collection. We are working on addressing this.Where is the realtime total JS heap size view?
The realtime Total JS heap size information is already available in the Memory panel. There is no plan to move that into the Performance panel.
The realtime total JS heap size in the Memory panel

Does the Performance panel support reload and record Node.js / Deno performance?
No. This proposal focuses on migrating the existing features in the Profiler tab to the Performance panel. The Profiler tab doesn’t support reload and record.
Questions for Discussion #
In addition to general feedback, we would like to collect feedback on the following specific questions:
Does the prototype correctly display JavaScript profiling information?
We are interested in any cases where the information is missing or has discrepancy with the Profiler tab.
Does profiling in the Performance panel UI work well for you?
We would be interested in any use cases where this change in UI would be problematic or burdensome, and where the UI is important.
For example, should we enlarge the Bottom-up tab and show it by default when you open the Performance panel in Node.js / Deno mode?
Beta Was this translation helpful? Give feedback.
All reactions