Code Profiling Tools for Perl

99封情书 提交于 2019-12-30 06:46:09

问题


I need to test Perl Application ( File operation , Data base operation..etc ) . I am looking for some profile tool for Perl code

is there any tools for Perl Code Profling like gprof in Linux


回答1:


Just like with debugging, profiling is a task best done by the perl interpreter itself

This website will give you an overview of using the -d:DProf argument to the interpreter, and how to use it.




回答2:


Some people might suggest to use Devel::DProf as the most standard way, but if you will look closely it's actually pretty bad solution.

The best profiler for perl now is Devel::NYTProf.

If you'll google for it, you will see some presentations that show what it is capable of. And it's a lot.




回答3:


Krish: before you post questions, you should at least check the basic documentation. One way to look for something is perldoc -q <something>. The -q flag kicks off a keyword search through the FAQ.

So, for example, perldoc -q profile:

Found in /usr/local/lib/perl5/5.10.0/pod/perlfaq3.pod
   How do I profile my Perl programs?
       You should get the Devel::DProf module from the standard distribution
       (or separately on CPAN) and also use Benchmark.pm from the standard
       distribution.  The Benchmark module lets you time specific portions of
       your code, while Devel::DProf gives detailed breakdowns of where your
       code spends its time.

And it goes on from there.



来源:https://stackoverflow.com/questions/1078980/code-profiling-tools-for-perl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!