Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re*Re^2: The High Price of Golf, and A Surprise

by hv (Parson)
on Mar 04, 2003 at 00:27 UTC ( #240203=note: print w/replies, xml ) Need Help??


in reply to Re*Re^2: The High Price of Golf, and A Surprise
in thread The High Price of Golf, and A Surprise

Just for the record: firstly, it used to be that even simplistic sort subs such as { $a <=> $b } would call out to perl code, but that was changed to look for certain common cases and substitute a C implementation instead; I think that change first appeared in 5.6.1, judging by comparative timings here.

Secondly, the bug in B::Deparse (which occurred simply because it wasn't immediately updated for the above change) was fixed in perl-5.8.0.

Just to give a feel for the difference it makes spotting and substituting a C-based routine for a perl-based one, I added an extra variant of i_sship tweaked to avoid the optimization:

i_sshipz => sub { @rin = sort { $a + 0 <=> $b } @nin },
and here is the table I got (running under 5.8.0):
Rate i_sshipz f_owtdi i_owtdi f_alpha i_alpha f_sship + i_sship i_sshipz 16.5/s -- -27% -28% -43% -52% -57% + -58% f_owtdi 22.6/s 37% -- -1% -22% -34% -41% + -42% i_owtdi 22.8/s 38% 1% -- -21% -33% -41% + -41% f_alpha 29.0/s 76% 28% 27% -- -15% -25% + -26% i_alpha 34.2/s 107% 51% 50% 18% -- -11% + -12% f_sship 38.5/s 134% 70% 69% 33% 13% -- + -1% i_sship 38.9/s 136% 72% 71% 34% 14% 1% + --

Hugo

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://240203]
help
Chatterbox?
[stevieb]: man, I absolutely LOVE driving in the worst winter conditions. In the mountainous roads, there are extremely few (if any) other drivers. I love the challenge. I've been doing extreme off-road my whole life, and as I said, I'm always well...
[stevieb]: ...prepared for even the very worst
Discipulus seems a part of the globe very unfrindly with Kawasaki riders..
[thezip]: My doggies love it when it snows
[perldigious]: As long as you are a good "boy scout" stevieb, more power to you... but I like my Jeep, and don't like the idea of rolling it or crashing it in to anything. :-)
[thezip]: Me, not as much.
[perldigious]: Mine too thezip, especially my German Shepherd. He looks like he is about to die of heat exhaustion all summer, so he goes nuts when winter comes and he can play in the snow.
[stevieb]: my main off-road vehicle nowadays is a strengthened mercedes ML320. I'm very hard on it, but I've never had any real issues at all (I love how small and light it is, and it has a very, very good centre of gravity for how I roll)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2016-12-06 16:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (112 votes). Check out past polls.