I have a fairly complex standalone script that I would like to make faster. I have already profiled it using Devel::NYTProf, and using the profiling results I have found and fixed a number of hotspots in the code.

I am now at a stage where there are some tuning parameters to adjust to try to get best performance. For example, on my DBIx::Class queries, which related resultsets should I pre-fetch.

At the moment I am trying to find the best settings for such parameters by doing multiple test runs with the profiler enabled, but with different settings for the parameters, and then comparing the html reports visually

The process works to show me large differences, such as a function taking 10 seconds under one set of settings, but only 5 under another, but the whole thing feels rather crude. For example there is no easy way to tell how time saved in one function has been moved to more time spent in other functions.

I have also considered using the Benchmark module to compare related runs, but it does not look like a good solution as it only considers overall execution time, and does not delve any deeper in to where my script spends it's time.

Is there a better way? Is there a feature of NYTProf that will let me compare the numbers from two runs of the same script (or very similar scripts) while suppressing statistically insignificant differences?


In reply to Differential profiling by chrestomanci

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.