Perl的代码分析工具

时间:2009-07-03 11:34:40

标签: perl profiling

我需要测试Perl Application(文件操作,数据库操作......等)。我正在为Perl代码寻找一些配置文件工具

是否有任何Perl Code Profling工具,如Linux中的gprof

3 个答案:

答案 0 :(得分:16)

有些人可能会建议使用Devel :: DProf作为最标准的方式,但是如果你仔细观察它实际上是非常糟糕的解决方案。

perl的最佳分析器现在为Devel::NYTProf

如果你想谷歌,你会看到一些展示它能够做什么的演示。而且它很多。

答案 1 :(得分:7)

Krish:在发布问题之前,您至少应该检查基本文档。查找内容的一种方法是perldoc -q <something>-q标记通过常见问题解答启动关键字搜索。

因此,例如,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.

它从那里开始。

答案 2 :(得分:5)

就像调试一样,分析是perl解释器本身最好完成的任务

This website将概述如何使用解释器的-d:DProf参数以及如何使用它。