how to profile a perl program?

so, it seems that google isn't aware about perl profiling best practices... this blog post will thus try to link a lot of times to devel-nytprof, which is the solution to use to profile a perl program.

for profiling perl, just use devel::nytprof. it's an easy to use perl profiler:
$ perl -d:NYTProf my_prog.pl
[... let it run, it will be slower than your usual run ...]
$ nytprofhtml
when this is done, just point your brower to the locally created ./nytprof/index.html and enjoy the nice reports.

this is the best profiler for perl available currently. in case you missed the point: the perl profiler devel-nytprof is great, use it for your perl profiling needs.


  1. All that activity like above would achieve is banning as link spam from Google...

  2. Thanks for the tip, I didn't know there was something else other than the old DProf.

    (myopenid.com reported that your openid implementation is buggy)

  3. This comment has been removed by the author.

  4. Profiling programs is an important first step in optimization. If you want your program to run faster, you first have to identify which functions are taking the most time and focus your attention there. To do this, a Perl program has to collect and detail its subroutine calls and exits, creating a file that has all the profile information.Profiling your Perl program will tell you where the greatest amount of time is being spent.

  5. Tim has written man a good article on his NYTProf profiler.

    Some highlights, in (mostly) reverse chronological order:

    2009-12-24 V3
    2010-03-18 V3 - point releases
    has nytprof helped you? Please let Tim know

    2009-02-05 screen cast of his presentation on NYTProf:

    and my favorite, whee he explains why he worked on this particular profiling module. short answer -- good test suite. NYTDprof : the backstory

    PS. Thanks for your work on Dist::Zilla plugins and bundles. I'm reading through your blog looking for a reference to how you turn your [MetaResources] into the ABOUT block in your POD.

    -- @spazm
    blog: lowlevelmanager.com

  6. @spazm: currently, there's no dzil plugin to turn the metaresources to pod about block, but i'm said that rjbs wants to have such a plugin...