From: six at aegis-corp dot org Operating system: linux 2.4 PHP version: 5.1.0RC1 PHP Bug Type: Date/time related Bug description: performance problem with date()
Description: ------------ performance of the date() function has taken a huge hit between PHP 5.0 and 5.1. i believe this is because of an unneeded syscall when a second argument is given. Reproduce code: --------------- <? for ($a = 0; $a < 100000; $a++) date("Y-m-d H:i:s", $a); ?> Expected result: ---------------- time /usr/local/bin/php-cli-5.0.4 datetest.php real 0m2.022s user 0m1.910s sys 0m0.000s Actual result: -------------- time /usr/local/bin/php-cli-5.1.0RC1 datetest.php real 0m10.001s user 0m8.120s sys 0m0.130s 5.1.0 takes more than 4x the time to complete than 5.0.4 with an strace, I can see that 5.1.0RC1 makes one (probably unneeded) time() syscall per call to date(), which 5.0.4 does not -- Edit bug report at http://bugs.php.net/?id=34700&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34700&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34700&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34700&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34700&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34700&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34700&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34700&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34700&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34700&r=support Expected behavior: http://bugs.php.net/fix.php?id=34700&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34700&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34700&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34700&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34700&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34700&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34700&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34700&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34700&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34700&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34700&r=mysqlcfg