Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^4: Inconsistent Results with Benchmark

by flexvault (Monsignor)
on Dec 08, 2014 at 15:31 UTC ( #1109590=note: print w/replies, xml ) Need Help??

in reply to Re^3: Inconsistent Results with Benchmark
in thread Inconsistent Results with Benchmark


++ for the good suggestion. And you can add a print statement for the *returned* results from each subroutine.

I've seen examples of 'benchmark'ing 2 subroutines that don't produce the same results. Unless the results are the same, it doesn't make sense to compare the subroutines.


"Well done is better than well said." - Benjamin Franklin

  • Comment on Re^4: Inconsistent Results with Benchmark

Replies are listed 'Best First'.
Re^5: Inconsistent Results with Benchmark
by benwills (Sexton) on Dec 08, 2014 at 23:44 UTC

    I learned that the hard way the other day. Since I don't need "exactly-the-same" results from my tests, I now normalize them and do a character count to make sure they're not too far off from each other. For what I'm doing, and at this stage of my process, that's perfectly fine.

    I'm also finding, with the constant back and forth between code and running a benchmark, a want for some other features in the Benchmark module. I wrote some stuff that makes the process faster and easier. At the end of this project, I might clean it up and get it up here.


        Since I don't need "exactly-the-same" results from my tests...
      But you do!

      You use 'benchmark' in your testing environment to see which sequence of Perl declarations and statements produce the *best* result. You determine the meaning of *best*, but if the results are almost, you're missing the value of 'benchmark'.

      For example, you may be testing the use of an array or a hash within different subroutines, but the final result ( whatever you determine is the result ) must be the same. You may determine that the subroutines produce a file, and that file must be the exact same for all the different subroutines you 'benchmark'.

      Humans ( including programmers ) don't have the exactness of computers and that's why we need a great script like 'benchmark' to run our different scripts hundreds/thousands/millions of times to give us the best sequence.

      Almost isn't the same as equal!


      "Well done is better than well said." - Benjamin Franklin

        I almost always firmly agree with you. But this is one of those times when "close" is fine at certain steps because there are multiple layers of analysis with the final result able to be produced in a number of ways due to some small overlaps in the text analysis.

        If you're curious, I can describe in more detail. A good analogy might be "how much should you clean up before the maid comes?"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1109590]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2019-12-07 18:43 GMT
Find Nodes?
    Voting Booth?
    Strict and warnings: which comes first?

    Results (162 votes). Check out past polls.