Profiling nodes with v8

I have a node application that I want to profile using the node profiler.

So first I ran:

node --prof v8test.js 

Then I downloaded v8 tools

 svn checkout http://v8.googlecode.com/svn/trunk/ v8; make dependencies; make native; 

Then I tried to analyze the created file (v8.log)

 tools/linux-tick-processor ../v8.log 

But I get a lot:

 Code move event for unknown code: 0x289dd8475560 Code move event for unknown code: 0x289dd84758e0 Code move event for unknown code: 0x289dd8479280 Code move event for unknown code: 0x289dd8482980 Code move event for unknown code: 0x289dd84c2a80 line 718730: unknown code state: undefined line 718731: unknown code state: undefined line 739575: unknown code state: undefined line 739577: unknown code state: undefined 

Can someone help me figure out what's going on?

+8
profiling v8
source share
3 answers

The log file format seems to change quite often, so you need to make sure that you are using the correct version of v8. For example, if the profile log was created using node v0.10.18, you need to analyze it using the tick processor for version v4 version 3.14.5. To find out which version of v8 this node version is installed on, you can check deps/v8/ChangeLog in the source distribution of node (node's own change log is apparently a bit unreliable in this regard).

+5
source share

Make sure you are not using a 64-bit version of node with a 32-bit version of profiling tools, or vice versa. I had a similar problem when I did this by accident.

0
source share

Another option for profiling a node application is to use VTune Amplifier instead of the internal V8 profiler built into Node.js. In this case, you will see how performance indicators are distributed through the source code of your function. V8 profile cannot do it now. Take a look at this post to find out how you do it.

0
source share

All Articles