From:             njaguar at gmail dot com
Operating system: any
PHP version:      5.4.9
Package:          Performance problem
Bug Type:         Bug
Bug description:Poor date() performance [PATCH]

Description:
------------
Full info here:
http://news.php.net/php.internals/64127

4.4.9 on old machine vs 5.4.9 on new machine:
date                    : 1.856 sec     date                    : 2.111 sec

after patch (~20% performance increase):
date: 1.763 sec

* new machine is 2 to 200x faster than old machine, see link above for more
details


Test script:
---------------
// common date output format

// use any preferred timing methods either within php, or externally time
execution of the script (eg, microtime(), etc) -- the former will be more
accurate at isolating the date() function, overall
$c = 1000000;
for($i=0; $i<$c; $i++) date('F j, Y, g:i a', $now);


Expected result:
----------------
worse performance on stock builds, better when patch is applied -- still
considerably slower than 4.4.9 version of date() and related, but is an
improvement

Actual result:
--------------
By moving the frequently used iso fetching function into the switch
statement, this prevents an otherwise unnecessary step for other more
common usages of date formatting.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63666&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63666&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63666&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63666&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63666&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63666&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63666&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63666&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63666&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63666&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63666&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63666&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63666&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63666&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63666&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63666&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63666&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63666&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63666&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63666&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63666&r=mysqlcfg

Reply via email to