PHP :: Bug #63666 :: Poor date() performance [PATCH]
| Bug #63666 | Poor date() performance [PATCH] | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2012-12-02 00:50 UTC | Modified: | - |
|
||||||||||
| From: | njaguar at gmail dot com | Assigned: | ||||||||||||
| Status: | Closed | Package: | Performance problem | |||||||||||
| PHP Version: | 5.4.9 | OS: | any | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2012-12-02 00:50 UTC] njaguar at gmail dot com
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.
Patches
date.patch (last revision 2012-12-02 00:50 UTC by njaguar at gmail dot com)Pull Requests
History
AllCommentsChangesGit/SVN commits
[2012-12-05 05:03 UTC] stas@php.net
-Status: Open +Status: Closed