more useful options PerlMonks

### Re^6: Question on Regex

by karlgoethebier (Parson)
 on Nov 19, 2012 at 20:24 UTC ( #1004609=note: print w/replies, xml ) Need Help??

in reply to Re^5: Question on Regex

Hello, one important thing i learned in the short time i'm on PM is: there is no reason to be ashamed to ask something that i don't know or understand. So i must confess that i have a problem to interpret the output of Benchmark in the right way. I didn't use this module very much yet.

I know when i use cmpthese, the results are sorted from slow to fast. When i say \$count = -10, my code runs for 10 wall clock seconds.

Then, in the rate column i can see the amount of iterations per second for each of the subs that i benchmarked - in our (first) case:

```karlgoethebier 105189/s
athanasius     627362/s

So i try:

```Karls-Mac-mini:Desktop karl \$ perl -e 'printf ("%.0f\n", 627362/105189
+);'
6

You wrote:...Which shows that sub athanasius is up to 5 times faster than sub karlgoethebier. Perhaps i have a mental block at the moment or i miss something really essential, sorry.

Thanks for advice and regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^7: Question on Regex
by Athanasius (Chancellor) on Nov 20, 2012 at 02:48 UTC

You’re quite right, I should have said “up to 6 times faster”. I was looking at the figure of 496%, and thinking “that’s almost 5,” but that figure is actually the increase in rate expressed as a percentage of the original. That is,

```(627362 - 105189) / 105189 = 4.9641 = 496%

The problem is, that concept — the increase in rate expressed as a percentage of the original — doesn’t mean much to me. Which may be why I have such a hard time remembering it!

i have a problem to interpret the output of Benchmark in the right way.

Me too! :-)

I know when i use cmpthese, the results are sorted from slow to fast.

Exactly, that’s the main point to keep in mind.

Athanasius <°(((><contra mundum

Thank you. I thought something was wrong with my beer last night ;-) Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Create A New User
Node Status?
node history
Node Type: note [id://1004609]
help
Chatterbox?
 [Eily]: looks more like "all my plates are broken and I don't understand why. Also I can't retrieve the broken parts because the elephant in the room is on the way" [ambrus]: Eily: also webpages aren't displayed on my monitor no matter what I click with the mouse, and there's a blackout right now, could that be a problem? [robby_dobby]: ambrus: Yes [hippo]: erix++: "the browser ate my code" [robby_dobby]: Eily: Now, people are trying to be inventive with crowdsourcing their work, eh? Sure, call on the admins to k-line these sockpuppet accounts! [robby_dobby]: hippo: I like how you equated your browser to a dog....

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2017-04-25 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
I'm a fool:

Results (454 votes). Check out past polls.