如何检查x64 MacOS X 10.7上`node –prof`的结果?
我尝试在CLI上剖析我的node.js脚本。
正如https://code.google.com/p/v8/wiki/V8Profiler或http://blog.arc90.com/2012/03/05/profiling-node-programs-on-mac-os- x / a做:
$ node --prof my_script.js
所有好的,我得到一堆名为v8.log
文件。
但是在检查工具中都出错了。
$ tools/mac-tick-processor v8.log
给我看
Statistical profiling result from v8.log, (298 ticks, 237 unaccounted, 0 excluded).
和空的JavaScript部分。
[JavaScript]: ticks total nonlib name
另外我尝试https://github.com/bnoordhuis/node-profiler ,但也得到一些结果。
我怎样才能使用–prof结果?
$ node -v v0.8.18 $ sw_vers ProductName: Mac OS X ProductVersion: 10.7.4 BuildVersion: 11E53
正如@Dogbert所build议的,您可以使用github.com/sidorares/node-tick
如果您缺less任何function,请随意创build拉取请求。 我还没有更新一段时间,它似乎仍然工作
节点4.4.0之后:
node --prof-process isolate-0xnnnnnnnnnnnn-v8.log > processed.txt
来自: https : //nodejs.org/en/docs/guides/simple-profiling/