$ node --prof # generates a v8.log file
$ npm install -g profiler
$ nprof # generates nice output from the log file
[Bottom up (heavy) profile]:
Note: percentage shows a share of a particular caller in the total
amount of its parent calls.
Callers occupying less than 2.0% are not shown.
ticks parent name
87455 43.9% /usr/local/bin/node
3188 3.6% LazyCompile: *DefineObjectProperty native v8natives.js:695
3186 99.9% LazyCompile: *DefineOwnProperty native v8natives.js:924
3184 99.9% LazyCompile: defineProperty native v8natives.js:1050
1538 48.3% LazyCompile: Instance.addInstanceProperty /Users/jfacorro/work/battles/node_modules/orm/lib/Instance.js:475
1538 100.0% LazyCompile: Instance /Users/jfacorro/work/battles/node_modules/orm/lib/Instance.js:8
1047 32.9% LazyCompile: Instance /Users/jfacorro/work/battles/node_modules/orm/lib/Instance.js:8
1043 99.6% LazyCompile: Model.createInstance /Users/jfacorro/work/battles/node_modules/orm/lib/Model.js:50
547 17.2% LazyCompile: *extendInstance /Users/jfacorro/work/battles/node_modules/orm/lib/Associations/One.js:144
510 93.2% LazyCompile: *exports.extend /Users/jfacorro/work/battles/node_modules/orm/lib/Associations/One.js:119
37 6.8% LazyCompile: ~exports.extend /Users/jfacorro/work/battles/node_modules/orm/lib/Associations/One.js:119
2564 2.9% LazyCompile: *createWriteReq net.js:658
...
$ node --prof # generates a v8.log file
$ npm install -g profiler
$ nprof # generates nice output from the log file
[Bottom up (heavy) profile]:
Note: percentage shows a share of a particular caller in the total
amount of its parent calls.
Callers occupying less than 2.0% are not shown.
ticks parent name
87455 43.9% /usr/local/bin/node
3188 3.6% LazyCompile: *DefineObjectProperty native v8natives.js:695
3186 99.9% LazyCompile: *DefineOwnProperty native v8natives.js:924
3184 99.9% LazyCompile: defineProperty native v8natives.js:1050
1538 48.3% LazyCompile: Instance.addInstanceProperty /Users/jfacorro/work/battles/node_modules/orm/lib/Instance.js:475
1538 100.0% LazyCompile: Instance /Users/jfacorro/work/battles/node_modules/orm/lib/Instance.js:8
1047 32.9% LazyCompile: Instance /Users/jfacorro/work/battles/node_modules/orm/lib/Instance.js:8
1043 99.6% LazyCompile: Model.createInstance /Users/jfacorro/work/battles/node_modules/orm/lib/Model.js:50
547 17.2% LazyCompile: *extendInstance /Users/jfacorro/work/battles/node_modules/orm/lib/Associations/One.js:144
510 93.2% LazyCompile: *exports.extend /Users/jfacorro/work/battles/node_modules/orm/lib/Associations/One.js:119
37 6.8% LazyCompile: ~exports.extend /Users/jfacorro/work/battles/node_modules/orm/lib/Associations/One.js:119
2564 2.9% LazyCompile: *createWriteReq net.js:658
...