Profiling CPU usage - smartscenes/sstk GitHub Wiki
Basic steps
- Run
node --prof app.jsto profile your program. It will output aisolate-0xnnnnnnnnnnnn-v8.logfile. - Run
node --prof-process isolate-0xnnnnnnnnnnnn-v8.log > profile.txtto get a human readable interpretation of the profile log. The resultingprofile.txtwill have the following sections.
[Shared libraries]
[JavaScript]
[C++]
[Summary]
[C++ entry points]
[Bottom up (heavy) profile]
-
Go to
[Summary]To get an overall breakdown of CPU usage by Javascript/C++/GC/...Go to
[JavaScript]or[C++]for the top CPU consuming functionsGo to
[Bottom up (heavy) profile]to get trace of callers for top CPU consuming functions
See https://nodejs.org/en/docs/guides/simple-profiling/ for more details.