Publications
As someone who spends a large amount of time programming, I often begin obsessing about the performance and tuning aspect of a project before it is warranted by the development cycle.
Shadow

Introduction

Donald Knuth, the father of the analysis of algorithms once wrote "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil". Although often quoted, the message should be considered by project developers during the programming cycle. As someone who spends a large amount of time programming, I often begin obsessing about the performance and tuning aspect of a project before it is warranted by the development cycle. This often becomes a problematic sidebar and can derail the forward motion of the project instantly.

Is this a strange thing to happen to someone who is constantly preaching the use of cost/gain analysis to his clients? Absolutely... yet I feel that in this 'information age' it is easy to get bogged down in a flood of raw data and opinions if there is not a method present to effectively filter it.

A Great Information Filter - Realistic Analysis

Fig. 1 - A series of benchmarks that compare string output function execution speed (source: www.phpbench.com)

The PHP benchmark data given in Fig. 1 appears to indicate a stark contrast of string output function speed - and thus a significant difference in overall performance. One should, however, first consider the overall effect on a typical project. Based on the data given in Fig.1, for a website that receives 100,000 pageviews per day the total CPU time gained by using the absolute least efficient function compared to the one with the highest efficiency is:

which corresponds to less than 1/20th of a second per day. Hypothetically, if a developer were to spend approximately 4 hours to examine a project's core engine to find 40 uses of the least efficient method, you would only save ~2 seconds/day of CPU time (Over the 100k pageviews). This would correspond to a turnover of time investment in approximately 7200 days (or ~20 years) - well beyond the average lifespan of any web presence. Aside from this, it is unlikely that each visitor would be aware of the 40 nanosecond difference per pageview you saved them with these modifications.

Code Structure - A Priority over Function Optimization

As an alternative to function choice optimization, I propose that devoting time to ensuring an adherence to a standard set of PHP/MySQL 'best practices' provides a much greater long-term gain. Some of these best practices to keep in mind during development are:

Page Load Times - The Elephant in Your Server Room?

Additionally, large benefits can be delivered through optimization of webpage load time through the size of media on the page. Whereas tuning of SQL and PHP function performance offers a performance boost in the order of microseconds per execution, analysis and optimization of on-page graphics and media (as well as redundant HTML code) provides the reduction of time-to-screen for surfers on the scale of seconds (and higher). By:

you can successfully performance tune with a positive and instantly noticeable overall effect.