nodegrind
Profile nodejs applications with kcachegrind, either using the nodegrind wrapper or the more targeted profiling module.
Installation
Node 0.10
npm install nodegrind@0.5.0
Node 4.2
npm install nodegrind
Full-program profiling:
node nodegrind [-o callgrind.out.<pid>] <main.js> <params>kcachegrind nodegrind.callgrind
Targeted profiling by using nodegrind as a module
var nodegrind = fs = ; nodegrind; // Run the code you are interested in // Get the callgrind profile as a stringvar prof = nodegrind;fs;// open kcachegrind with 'kcachegrind callgrind.out.someProfile' // Alternatively, get a Chrome *.cpuprofile that you can load into the Chrome// profiler (right-click on 'Profiles' in left pane in the 'Profiles' tab)var prof = nodegrind;fs;