### Re^5: Question on Regex

by karlgoethebier (Monsignor)
 on Nov 19, 2012 at 14:15 UTC ( #1004546=note: print w/replies, xml ) Need Help??

in reply to Re^4: Question on Regex

Thats's nice! It's not a good habit to be too greedy. Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^6: Question on Regex
by karlgoethebier (Monsignor) on Nov 19, 2012 at 20:24 UTC

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»

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://1004546]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2018-06-23 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Should cpanminus be part of the standard Perl release?

Results (125 votes). Check out past polls.

Notices?