PDA

View Full Version : PHP performance


jsebrech
06-21-2005, 03:25 PM
I know this isn't really a PHP guru forum, but it doesn't hurt to ask.

I'm currently writing a performance sensitive PHP bit. And while some optimizations make sense, others don't. For example, placing this code before other code at a specific point in the body of my main loop makes the whole thing 1.5 seconds faster (goes from 5.1 to 3.6 seconds), while producing the exact same output (I doublechecked):
if (FALSE) {
break;
};
Does anyone have any clue on what could be causing this? I'm thinking byte misalignment, cache miss, poorly filled pipelines, but, why such a large difference?

Incidentally, running the code with that if statement in through the zend optimizer makes it take 8 seconds instead of 3.6. And I guarantee the output is identical! I'm running PHP as a CGI executable, so it isn't related to something modulewise being incorrect.

Gibberish
06-21-2005, 06:07 PM
If you don't get your answer here you might have better luck over at SitePoint (http://www.sitepoint.com/forums/)