代码之家  ›  专栏  ›  技术社区  ›  joe

Perl的代码分析工具

  •  5
  • joe  · 技术社区  · 15 年前

    我需要测试Perl应用程序(文件操作、数据库操作等)。我在找一些Perl代码的配置文件工具

    在Linux中有没有类似gprof的Perl代码处理工具?

    3 回复  |  直到 15 年前
        1
  •  5
  •   Jeremy Smyth    15 年前

    与调试一样,分析也是Perl解释器本身最好完成的任务。

    This website 将为您提供使用 -d:DProf 解释程序的参数,以及如何使用它。

        2
  •  16
  •   user80168    15 年前

    有些人可能会建议使用devel::dprof作为最标准的方法,但如果您仔细观察,这实际上是一个非常糟糕的解决方案。

    这个 现在Perl最好的分析器是 Devel::NYTProf .

    如果你用谷歌搜索它,你会看到一些展示它的能力的演示。而且很多。

        3
  •  7
  •   Telemachus MrJames    15 年前

    克丽什:在发布问题之前,你至少应该检查一下基本文档。找东西的方法之一是 perldoc -q <something> . 这个 -q Flag通过常见问题解答启动关键字搜索。

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

    从那里开始。