News for hackers. Stuff that matters.
Re:Highly efficient PHP code writing by Nicolas___ on Tuesday March 06, 2012 @05:43AM (#3670446)
These tips are good practices, but they are micro-optimisations. The function strtr might be 4 times faster than str_replace, but the time saved by using strtr will represent a tiny tiny tiny portion of your script execution time.

Micro-optimisations are worth it when everything else is optimized in your application. You might get way better results by focusing on your database structure or the way you store, retrieve and cache your data.

What's listed here doesn't lead to "highly efficient code". More like "A tiny little bit more efficient code". Doesn't hurt doing it though.

Re:Highly efficient PHP code writing by sonic0002 on Wednesday March 07, 2012 @01:41AM (#3674553)
Actually, these tips for PHP coding cannnot guarantee improving efficiency in every project. For different apps,some of these tips may be very useful.For example, I was involved in one of the H.264 decoder development, some of the tiny operations would be run thousands times when decoding a video clip, even a small optimization improved the peformance largely.