Optimize Optimize …


The PHP community responded actively to a some PHP optimization tips posted by Google in the series Let’s make the web faster.

We pointed previously to Marco’s article stop telling people to optimize, and start teaching them to program. Gwynne Raskind posted a response in the Google Groups pointing that all these optimizations are incorrect.
After all, these are all micro optimizations tips and you will probably find such tips useful if you are beginner PHP programmer, from intermediate to expert developers you should not need to “worry much” about these issues for two reasons : first micro-optimization should be part of your coding standard, secondly in most common PHP projects this won’t help make your application faster.
I think the only issue that should be raised here is : which PHP version are you optimizing for ?! If you are optimizing for PHP5.1, what about all issues that have been fixed in 5.2 ? And if you are talking about PHP4, when will you consider to switch to PHP5 ? And what about tips that run fast in PHP 5.1 and become slow in 5.2 ?! should you micro-optimize your code for each upgrade ?
If you really worry about your web application speed, most important optimization should be done at the database level, or at servers architecture if you are developing really huge application. Otherwise just keep your code clean, use a debugger, write your UnitTest, keep caching solutions the latest step. Then start thinking about scalability.
Related links :