Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to inspect result of `node --prof` on x64 MacOS X 10.7?

I try to profile my node.js script at CLI.

As written at https://code.google.com/p/v8/wiki/V8Profiler, or http://blog.arc90.com/2012/03/05/profiling-node-programs-on-mac-os-x/ a do:

$ node --prof my_script.js

All ok, I get file named v8.log with bunch of lines.

But then in inspection tools all go wrong.

$ tools/mac-tick-processor v8.log

show to me

Statistical profiling result from v8.log, (298 ticks, 237 unaccounted, 0 excluded).

and empty JavaScript section.

[JavaScript]:
  ticks  total  nonlib   name

Also I try https://github.com/bnoordhuis/node-profiler, but get some results too.

How I can work with --prof results?

$ node -v
v0.8.18

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.7.4
BuildVersion:   11E53
like image 886
Meettya Avatar asked Feb 12 '13 09:02

Meettya


2 Answers

As suggested by @Dogbert you can use github.com/sidorares/node-tick

Feel free to create pull request if you missing any functionality. I haven't updated it for quite a while and it still seems to work

like image 196
Andrey Sidorov Avatar answered Oct 14 '22 11:10

Andrey Sidorov


After Node 4.4.0:

node --prof-process isolate-0xnnnnnnnnnnnn-v8.log > processed.txt

From: https://nodejs.org/en/docs/guides/simple-profiling/

like image 32
Kaan Soral Avatar answered Oct 14 '22 12:10

Kaan Soral