in reply to references best practice
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 | |
by roboticus (Chancellor) on Apr 25, 2008 at 18:13 UTC |