Re: [PHP] Odd performance problem

[email protected] (Robert Cummings)
Newsgroups php.general
Organization InterJinn
Message-ID <1210319031.31111.69.camel@blobule>
On Wed, 2008-05-07 at 17:31 +0200, Joeri Sebrechts wrote:
> Hello,
> 
> While debugging a script that ran too slowly I came across something that I 
> can't explain.
> 
> It is inactive code that when removed doubles the run time of the script.
> 
> Specifically, the issue is a switch statement, where one of the cases is 
> never reached. If I remove the case from the code, the run time of the 
> script goes from 6 seconds to 12 seconds.
> 
> To see this problem in action, you can download the problematic script here:
> http://sebrechts.net/files/2008/phpperfissue.zip
> 
> Anyone have any ideas on how this is even possible? I'd like to improve the 
> run time of the script, but if every part of code that I take out makes it 
> run longer ...

Runs the same for me either way... under PHP4 and PHP5. You must have a
nice system, takes 22 seconds both ways on my Athlon 2400 :)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.