ysth,
++ 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.
Regards...Ed
"Well done is better than well said." - Benjamin Franklin
| [reply] |
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.
| [reply] |
benwills,
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!
Regards...Ed
"Well done is better than well said." - Benjamin Franklin
| [reply] |
No idea why I didn't think of that, but, based ons some tests, it looks like that works. For good measure, I'm loading it twice. And it keeps me from having to guess at how large of a string to create.
Thank you.
| [reply] |