PHP Perfomance Tips by the Beloved Google
View Single Post
06-29-2009, 11:24 AM
Join Date: Oct 2007
Location: Manchester, UK
PHP's very own gwynne wrote to them:
Yep, but there are plenty more performance tips that people take as fact, it would be really cool if they were officially debunked.
However, I do think that some of his statements do require a proper example and explanation.
I used the benchmarks provided by him for the double-quoted strings, I found that concatenation is still faster (just about, but it doesn't help his cause though),
My benchmark results:
I do realize he says "
interpolation is no slower (and often faster) than single- quoted strings using concatenation.
It would have been a good idea for him to provide an example that would back his claim, that it is 'often faster'.
"Depending on the way PHP is set up on your host, echo can be slower
than print in some cases."
Would have also been good to show us exactly where this would be the case, but so far we don't have any real evidence that confirms or denies the performance difference.
All in all, I don't doubt the guy as he clearly has far more knowledge of the internals of the PHP engine than I do, but it would be nice for him to actually back his claims properly and seen as though he portrays himself as 'part of the PHP team' (which I don't doubt, so don't start posting screenshots of PHP CVS commit messages etc, I'm not interested) I would expect some in-depth evidence to prove his case, especially as his evidence seems to be placing egg on Google's face slightly (and many other respected developers I should add).
Until somebody actually comes out and says yes
performance tip is a load of old garbage because
'insert suitable explanation here, not JUST benchmarks'
then we PHP developers can only ever continue with out current good practices (which according to the post on Google, are now for the most part, incorrect).
On the other hand, I've never been a fan of micro-optimizations too much, the biggest bottle necks come from badly designed code and badly constructed SQL queries, as well as other factors like network latency etc.
To conclude, I am grateful for him taking the time to debunk these so-called 'myths', but I do think he could have explained his case a little better.
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
View Public Profile
Send a private message to sketchMedia
Visit sketchMedia's homepage!
Find More Posts by sketchMedia