Penny pinching

1079902714000

Have you ever gone over your coding changing i += 1 to i++ Lots of people do. In some languages like PHP there are heaps of other things that you can do to shave off a few millisecods from script execution time. Changing double quotes to single quotes, tweaking your includes figure among the most commonly used tactics.

Is it worth it? certainly not in my book. Real speed of any application is a direct result of good architecture and good algorithms. If your logic results in a three table join in your database there's no way that code optmization is going to give you any increase in speed.

This was a recent debate on the PHP general mailing lists. Some pundits started questions along the lines of how do i optimize etc and I gave the above responds. These same pundits then started talking about how millionaires save pennies. If these pundits know so much why do they ask questions in the newsgroups in the first place? Finally Rasmus himself stepped in and said something to the effect that optimizing includes isn't worth it. The pundits had more sense than to argue with Rasmus and I think we have seen the end of that thread.

comments powered by Disqus