Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: Smoothsort

by Laurent_R (Canon)
on Sep 20, 2015 at 08:44 UTC ( #1142545=note: print w/replies, xml ) Need Help??

in reply to Re: Smoothsort
in thread Smoothsort

Hi Athanasius,

your point about the range-computing subroutine being called only once when using a Perl-style foreach loop (as compared to the "equivalent" C-style loop) is very interesting.

I sometimes wondered, in similar cases, whether I should pre-compute the range limits in order to sort of cache them before entering the for loop, but never actually cared to check, now I know that, in such cases, Perl is actually doing the value caching for you. Good to know. Thank you, Athanasius.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2021-09-23 09:47 GMT
Find Nodes?
    Voting Booth?

    No recent polls found