On 21/05/2012 21:12, sono...@fannullone.us wrote:
Hi Paul,
Please don't care about this until your code is running correctly but
too slowly and profiling has determined that this is the bottleneck.
I'm curious as to why you say this. If one way is faster than
another, wouldn't it be better to do it that way, as long as it
doesn't cause any problems?
BTW, my code is running correctly. I'm refactoring an old script.
The way I see it, every little bit helps. =;)
Random optimisation improves program performance like buying a lottery
ticket increases your wealth: the difference it makes is insignificant.
Washing and waxing your car every morning before you use it would reduce
the petrol consumption, but you don't. Why?
No one will thank you for making a program that completes in five
seconds run in 4.997s instead. On the other hand you will be shaken by
the hand for writing something that is readable and intuitive.
Thirty years ago it took several minutes to sort a few thousand values,
and we still often struggle to realise that that has changed. These days
you should write things as clearly as possible: 99 times out of a
hundred that will also be fast enough. If not, use a profiler to look
for places to optimise your code. (Hint: it won't be in the way your
subroutines collcet their parameters.)
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/