Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Ampersands and sub speed

by Zaxo (Archbishop)
on Oct 14, 2005 at 21:21 UTC ( [id://500374]=note: print w/replies, xml ) Need Help??


in reply to Ampersands and sub speed

Agreed with the previous replies.

You missed a few calling conventions,

cmpthese( -1, { k1 => sub { $foo->do_nothing }, k2 => sub { Foo->do_nothing }, k3 => sub { Foo::do_nothing }, k4 => sub { do_nothing }, k5 => sub { &do_nothing }, k6 => sub { do_nothing() }, k7 => sub { Foo::do_nothing()}, k8 => sub { &Foo::do_nothing }, });
and even at that, I left out some. Results:
Rate k2 k1 k3 k4 k6 k7 k5 k8 k2 379516/s -- -14% -31% -34% -35% -38% -48% -48% k1 442514/s 17% -- -20% -24% -24% -28% -39% -40% k3 550801/s 45% 24% -- -5% -6% -10% -24% -25% k4 579231/s 53% 31% 5% -- -1% -6% -20% -21% k6 584645/s 54% 32% 6% 1% -- -5% -20% -20% k7 614031/s 62% 39% 11% 6% 5% -- -16% -16% k5 727406/s 92% 64% 32% 26% 24% 18% -- -1% k8 735179/s 94% 66% 33% 27% 26% 20% 1% --
Evidently your box is considerably faster than mine.

After Compline,
Zaxo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-26 05:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found