#40970 [NEW]: filemtime slower on PHP5 vs PHP4

From: Date: Sun, 01 Apr 2007 00:16:16 +0000
Subject: #40970 [NEW]: filemtime slower on PHP5 vs PHP4
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-110986@lists.php.net to get a copy of this message
From: php at edwardk dot info Operating system: Windows 2003 PHP version: 5.2.1 PHP Bug Type: Performance problem Bug description: filemtime slower on PHP5 vs PHP4 Description: ------------ filemtime and other related functions are slower on php5 vs php4 Using PHP 5.2.1 and PHP 4.4.6 on Athlon X2 3800+, Windows 2003 the speed difference is about 50-100x slower. Reproduce code: --------------- <? header('Content-type: text/plain'); function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); for ($i = 1; $i <= 1000; $i++) { $blah = stat('.'); } $time_end = microtime_float(); $time = $time_end - $time_start; echo 'Took '.round(($time*100),3).'ms'; ?> Expected result: ---------------- Speeds should be similar Actual result: -------------- On PHP 4.4.6, it took about 1.6ms On PHP 5.2.1 it took about 130ms -- Edit bug report at http://bugs.php.net/?id=40970&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40970&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40970&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40970&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40970&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40970&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40970&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40970&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40970&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40970&r=support Expected behavior: http://bugs.php.net/fix.php?id=40970&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40970&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40970&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40970&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40970&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40970&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40970&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40970&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40970&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40970&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40970&r=mysqlcfg

« previous php.bugs (#110986) next »