Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Community News:
Benchmarking PHP 4.3.2
Jun 12, 2003 @ 12:18:58

In a thread over on the php-internals mailing list these past few days, it was suggested that PHP 4.3.2 was slower than 4.1.2, and Rasmus himself has issued back a response.

The original note about the slowness was: I've been doing some tests and have found that this code runs about 2.5 times slower under 4.3.2 than it did on 4.1.2 on the same machine (running OS X). To which the almost immediate response from Rasmus stated that he should:

  • don't use open_basedir or safe_mode restrictions always include/require files by their absolute paths (./foo.inc is ok)
  • if you have to use include_path includes, make sure the dir you hit most often is first in the include_path (even before .)
  • optimize your code. ie. don't use while(!feof($fp)) to loop through a file, check the return of your fgets() instead, for example.

So, if you too are seeing some slowness with the new upgrade, then you might check out this thread for some pointers, and take a look at the suggestions above.

Thanks to PHPEverywhere for the pointer...

tagged:

Link:


Trending Topics: