From: j at bolinos dot ch
Operating system: Windows XP
PHP version: 5.0.0
PHP Bug Type: Performance problem
Bug description: some functions are slower (10x slowest) than using php4
Description:
------------
file_exists, include, include_once, require, require_once and getimagesize
are about 10x slower than their php4 version.
Using Apache 2.0.48, Windows XP
Php 5.0.0 versus Php 4.3.6 on the same computer.
Reproduce code:
---------------
Tested using this function either with file_exists, include, include_once,
require, require_once and getimagesize
function FileExists($file,$nb,$para="")
{
$aT=array();
$aT[0]=microtime(false);
for($t=0;$t<$nb;$t++){
file_exists($file);
}
$aT[1]=microtime(false);
return $aT;
}
Actual result:
--------------
Mean for 100 repeated tests
Using php 5.0.0:
include mean: 0.0029407 (s)
require mean: 0.0030178 (s)
include_once mean: 0.0022040 (s)
require_once mean: 0.0023427 (s)
file_exists mean: 0.0000355 (s)
file_exists and clearstatcache mean: 0.0013877 (s)
Using php 4.3.6:
include mean: 0.0002966 (s)
require mean: 0.0002929 (s)
include_once mean: 0.0001056 (s)
require_once mean: 0.0001038 (s)
file_exists mean: 0.0000028 (s)
file_exists and clearstatcache mean: 0.0000749 (s)
--
Edit bug report at http://bugs.php.net/?id=29293&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29293&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29293&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29293&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29293&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29293&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29293&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29293&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29293&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29293&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29293&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29293&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29293&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29293&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29293&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29293&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29293&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29293&r=float