So how long does you script take to run and how many times does you script execute such code per run? For example, if your script takes 0.01 seconds to run, and you execute this code 100 times per run, then, based on my benchmarks, the 15% speed-up in this code will make your script run about 0.000063 seconds faster, or less that 0.6% faster.

I suspect that your script takes longer than that to run and that it doesn't execute that code that many times so your "savings" are even more miniscule.

But to answer you question, "I don't care." (:

When benchmarking, I mostly discount difference under 20% as a 5% or 10% difference can often be due to which test gets run first, or other unimportant details and so 20% is a pretty minor difference.

But most benchmarks I see (even most of the ones I've done) are timing microscopic operations and so even a 10-fold speed increase is likely to be nearly completely dwarfed by the rest of the work being done. Now, when you benchmark a microscopic operation that your script doesn't even do a few thousand or million times, then you are really going to a lot of work to fairly accurately measure how insignificant the change is, and then focusing on the wrong number.

And when you do these benchmarks before you have even identified that you have a performance problem and that the operation is in fact part of a bottleneck, then you are pre-optimizing. And premature nano-optimization is very common (at least in Perl circles) and can be kind of fun, but you should mostly ignore it beyond the "fun" aspect.

So I might find it fun if someone figures out the cause of this speed difference. But I don't really care. :)

        - tye (but my friends call me "Tye")

In reply to (tye)Re: Hair Splitting? by tye
in thread Hair Splitting? by harleypig

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.