DreamT has asked for the wisdom of the Perl Monks concerning the following question:

Hi!

I have a script with a lot of subroutines, and I want to measure the time it takes to run them, and i want to do it over time, for statistics. And, I don't want to put start/stop-markers in every sub :-D

Is there a method/module for this?

Replies are listed 'Best First'.
Re: "Automated" benchmarking
by marto (Cardinal) on Jan 24, 2012 at 11:05 UTC
Re: "Automated" benchmarking
by BrowserUk (Patriarch) on Jan 24, 2012 at 11:07 UTC

    The type of tool you are looking for is called a "profiler". Typing that into CPAN yields many hits.

    My personal preference is Devel::SmallProf. If you are a fan of verbosity and pretty pictures, you may like Devel::NYTProf.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      Besides the verbose and pretty output of Devel::NYTProf it is also quite more accurate than Devel::SmallProf!

        In what way?


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

Re: "Automated" benchmarking
by Anonymous Monk on Jan 24, 2012 at 11:03 UTC