Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: references best practice

by jethro (Monsignor)
on Apr 25, 2008 at 15:04 UTC ( #682852=note: print w/replies, xml ) Need Help??


in reply to references best practice

Just as a reminder:

One of the biggest sins of programming is optimizing for speed too early. One should first optimize for clarity. If and only if the performance is then lacking should one look at hot spots and other ways to speed up the program.

Getting the data from the database is probably at least a hundred times slower (totally unsubstantiated guess by me) than the returning of the array. If you double the speed of the sub return it means only a speedup of 0.5% of the subs runtime.
If that sub takes up 20% of the total runtime of the program, we are already in tenth of a percent territory.

Famous quote:
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." C.A.R. Hoare

Replies are listed 'Best First'.
Re^2: references best practice
by hsmyers (Canon) on Apr 25, 2008 at 15:50 UTC
    Likewise remember that 97% of coders use this as an excuse to write sloppy code 50% of the time.

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."

      ...and don't forget that 72% of all statistics are just random numbers some wiseacre pulled out of a hat.

      ...roboticus

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2020-01-26 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?