Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Given When Syntax

by LanX (Saint)
on Mar 17, 2014 at 00:16 UTC ( [id://1078557]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Given When Syntax
in thread Given When Syntax

Dear Laurent,

Thanks for providing timings, I appreciate this!

I said "should" because I was too busy to measure it myself.

But maybe someone has the time to do these benchmarks properly? :)

Cheers Rolf

( addicted to the Perl Programming Language)

Replies are listed 'Best First'.
Re^4: Given When Syntax
by Laurent_R (Canon) on Mar 17, 2014 at 14:39 UTC
    Hi Rolf, there may be some errors in the benchmark, but then you should say what is wrong, rather than just implying it was not done properly.
      I'll post benchmarks after GPW.

      Sorry but ATM you are mangling different things and effectively comparing apples with plastic food.

      BTW as it seems you are also "proving" that gotos to labels with code execution are faster then simple hash look ups. (which would support using goto)

      update

      I'm not sure but I somehow remember benchmarks indicating that goto was not very efficiently implemented.

      By having a linear complexity, it could be in small cases faster than the constant overhead of hash lookups.

      Cheers Rolf

      ( addicted to the Perl Programming Language)

        BTW as it seems you are also "proving" that gotos to labels with code execution are faster then simple hash look ups.

        The difference might come from something else, such as the use of a regex on the one hand, and of substr on the other hand for extracting the first digit. I did not change them because I wanted to use the various solutions as posted, or as close as possible to the way they were posted. After all, the way to get the first digit is also part of the solution. But, of course, if one wants to compare only the process for finding the values associated with that digit, then the easiest is to remove the digit extraction part by passing a single integer to the function. That was not my goal when posting the benchmark above, but I can certainly do that later when I get home, but not right now.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 18:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found