admin管理员组文章数量:1200781
I am looking for a method to do precise Node.JS
profiling of script execution times on Linux.
There are interesting projects like the NodeTime Performance Profiler, but this profiles the timing of I/O httprequests and such, not execution time of lines of code.
I am looking for a way to figure out exactly where I can optimize my Javascript, where most of the time is spent, etc.
One interesting method I've seen is trying to create a FlameGraph using DTrace to profile Node.JS.
However, dtrace
is very Solaris-specific.
- For Linux (Debian/Ubuntu),
dtrace
can be found in thesytemtap-sdt-dev
package. However,stap dtrace
is not the same, and lacks all relevant hooks/probes. - Paul Fox made a port from the Unix version. It's more feature complete but somehow the hooks/probes don't work in userspace as the Solaris one, and also cannot be used to profile node.
/ (It's pretty easy to build, see README.) - There's also an
Oracle
port, but noone would recommend it. Apparently, it only has about 0,1 percent of the probes the Paul Fox port. (Which is ironic, becauseOracle
was formerlySun
, original authors ofdtrace
forSolaris
)
How, in Linux, using the terminal or using Eclipse, can I profile the code of my Node.JS scripts? I'm looking for something specific like the Zend Profiler shows execution times of each command in code of PHP scripts.
I am looking for a method to do precise Node.JS
profiling of script execution times on Linux.
There are interesting projects like the NodeTime.com Performance Profiler, but this profiles the timing of I/O httprequests and such, not execution time of lines of code.
I am looking for a way to figure out exactly where I can optimize my Javascript, where most of the time is spent, etc.
One interesting method I've seen is trying to create a FlameGraph using DTrace to profile Node.JS.
However, dtrace
is very Solaris-specific.
- For Linux (Debian/Ubuntu),
dtrace
can be found in thesytemtap-sdt-dev
package. However,stap dtrace
is not the same, and lacks all relevant hooks/probes. - Paul Fox made a port from the Unix version. It's more feature complete but somehow the hooks/probes don't work in userspace as the Solaris one, and also cannot be used to profile node.
ftp://crisp.dyndns-server.com/pub/release/website/dtrace/ (It's pretty easy to build, see README.) - There's also an
Oracle
port, but noone would recommend it. Apparently, it only has about 0,1 percent of the probes the Paul Fox port. (Which is ironic, becauseOracle
was formerlySun
, original authors ofdtrace
forSolaris
)
How, in Linux, using the terminal or using Eclipse, can I profile the code of my Node.JS scripts? I'm looking for something specific like the Zend Profiler shows execution times of each command in code of PHP scripts.
Share Improve this question asked Oct 30, 2012 at 16:22 RedsandroRedsandro 11.4k15 gold badges80 silver badges111 bronze badges3 Answers
Reset to default 8"look" is a very good tool made by Vadim for profiling NodeJS app.
Take a look here:
https://github.com/baryshev/look
If you're not against using nodetime, it actually does have CPU profiling:
See: http://nodetime.com/blog/cpu-profiling-with-nodetime
https://www.npmjs.org/package/node.profiler Exactly what you need... It runs your project in monitor mode and it generates a chart after you are done with details on functions, each how many times it was called and the time it spent there.
本文标签: javascriptProfiling NodeJS (code) execution time in LinuxStack Overflow
版权声明:本文标题:javascript - Profiling Node.JS (code) execution time in Linux - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738613582a2102774.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论