3 ms·
Whats that profiler being used?
by randompi 4y ago
Whats that profiler being used?
- hajile 4y agoLooks like the one built into chrome. You can open your browser and attach a node instance so you can debug and profile it. Here's a basic How-to: * Run node with `node --inspect <file>` * Open Chrome and go to `chrome://inspect` * After it finds your target, click the inspect button to launch a debugger.
- alangpierce 4y agoIt looks to me like the profile viewer is actually speedscope ( https://www.speedscope.app/ https://www.speedscope.app/ ). I find it nicer for exploring profiles compared with Chrome's built-in viewer. To use with Node.js profiling, do the `node --inspect` and `chrome://inspect` steps, then save the profile as a .cpuprofile file and drag that file into speedscope. Another thing I've found useful is programmatically starting/stopping the profiler using `console.profile()` and `console.profileEnd()`.
- jansan 4y agoThat is a great tool. Also, I learned about perfetto the first time today, after doing Javascript profiling for a few years.
- mhagemeister 4y agoAuthor here. Answered this elsewhere here: It's the `--cpu-prof` argument with node and the resulting profile is loaded into speedscope.