node.jsprofiling

How can I alter the polling interval when using node --prof?


I have a node program I'd like to profile. If I use --prof I can get a profile output (isolate-xxx) that I can process with node --prof-process. Unfortunately, since the program is fairly quick (although still a lot slower than I'd like - it's around ~2s when I think it should be in the millisecond range - otherwise I wouldn't bother profiling), the profile isn't particularly granular. There is an option --cpu-prof-interval which should allow finer-grained profiling but that only appears to work with --cpu-prof not --prof and the output of that doesn't work with --prof-process

Is there a way to either:


Solution

  • The CPU profile can't be processed by --prof-process but it can be loaded into the developer tools of a browser in the "Performance" tab and viewed there. Would be nice if the docs made that a bit more obvious!