4 ms·
Even if all the tips were valid, the performance gain is tiny in comparison to simply installing an opcode cache (APC/Zend/etc). And even after installing the
by nir 17y ago
Even if all the tips were valid, the performance gain is tiny in comparison to simply installing an opcode cache (APC/Zend/etc).
And even after installing the opcode cache, performance for many web apps doesn't improve much as the bottleneck is often in the DB. Caching DB results where possible (pretty simple to implement with your own code or an external library) often results in far greater performance gain than any type of code optimization. If you can actually cache the resulting HTML (all or parts), even better.
- quizbiz 17y agoIn very high volumes, tiny performance gains change user behavior.
- norova 17y agoLet's be honest, though. Most people accepting these tips without second thought probably aren't catering to high volumes of people.
- dasil003 17y agoNoticeable performance gains change user behavior at any volume. The only difference volume makes is the cost-benefit, ie. it's a no-brainer for google to spend $100,000 for a 5% gain in their home page performance which is not true for the vast majority of sites. But we're still talking about improvements of at least 1%. Some of this PHP stuff Google was absolute nonsense--not just because it was technically wrong, which it was--but because string quoting method is never going to make even a single millisecond of difference in any real world PHP app. Even in contrived situations where it would, you could probably make an optimization that would have 3 orders of magnitude more difference by caching or using a C extension. This is the type of nonsense that 16 year old bedroom hackers with no experience or formal education come up with for their first blog post. Google out to be ashamed.
- nir 17y agoIn very high volumes, tiny performance gains might help each server handle a few more requests - but in that case, you're better off just adding another server rather than changing all the prints to echos or whatever ;) It is important to have scaling in mind when coding, but that had more to with eliminating 50 SQL queries per request situations - the code itself, certainly in a high level language like PHP, should be written for easy maintenance rather than performance IMHO.