Meettya
Meettya

Reputation: 345

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

Upvotes: 12

Views: 5112

Answers (2)

Kaan Soral
Kaan Soral

Reputation: 1665

After Node 4.4.0:

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

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

Upvotes: 3

Andrey Sidorov
Andrey Sidorov

Reputation: 25466

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

Upvotes: 8

Related Questions