Ask a Question related to PHP Bugs, Design and Development.
-
katzenmayer at erfnet dot de #1
#39968 [NEW]: date() is extremely slow
From: katzenmayer at erfnet dot de
Operating system: Debian Sarge
PHP version: 5.2.0
PHP Bug Type: Performance problem
Bug description: date() is extremely slow
Description:
------------
While switching a calendar script from PHP4 to PHP5 I noticed the script
takes multiple times as long to complete in PHP5 than it did in PHP4.
The problem seems to be date() and mktime() functions.
I did not notice any other PHP5 related performance issues. Scripts that
do not use date() or mktime() run very fast.
Reproduce code:
---------------
test.php:
<?
for ($i=0;$i<100000;$i++)
{
date('d');
}
?>
Now check this script with both PHP4 and PHP5:
time php4 test.php
time php5 test.php
Expected result:
----------------
The script should take about the same time in both PHP4 and PHP5
Actual result:
--------------
time php4 test.php
real 0m0.286s
user 0m0.034s
sys 0m0.252s
time php5 test.php
real 0m25.252s
user 0m18.579s
sys 0m5.615s
--
Edit bug report at [url]http://bugs.php.net/?id=39968&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=39968&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=39968&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=39968&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=39968&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=39968&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=39968&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=39968&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=39968&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=39968&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=39968&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=39968&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=39968&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=39968&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=39968&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=39968&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=39968&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=39968&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=39968&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=39968&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=39968&r=mysqlcfg[/url]
katzenmayer at erfnet dot de Guest
-
EXTREMELY slow file transfer HELP!
I have a tremendous problem. I have about 15 sites that I developed and manage with Dreamweaver. For some reason the transfer rate for one of them... -
Net::SSH::Perl extremely slow?
I have a simple perl script that connects to a remote machine and executes a command. Net::SSH::Perl seems etremely slow, but I've tried it on 2... -
Extremely Slow Printing in 6.01
Thanks for your response. That doesn't seem to help though. Whereabouts are the "issues regarding post script vs. PCL" that you mention? ... -
Extremely Slow WebService
My web service is running extrememly slow when consumed in Excel VBA (using MS Office XP Web Services toolkit to add a Web Reference to ws). I'm... -
Database is extremely slow
I have an Oracle 7.3.4.4 database that is experiencing extremely slow response times in the past few days. I know that one of the tables had as... -
iliaa@php.net #2
#39968 [Opn->Bgs]: date() is extremely slow
ID: 39968
Updated by: [email]iliaa@php.net[/email]
Reported By: katzenmayer at erfnet dot de
-Status: Open
+Status: Bogus
Bug Type: Performance problem
Operating System: Debian Sarge
PHP Version: 5.2.0
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
[url]http://www.php.net/manual/[/url] and the instructions on how to report
a bug at [url]http://bugs.php.net/how-to-report.php[/url]
You need to set the timezone, otherwise a notice is raised
which is what's killing the speed of your code.
Previous Comments:
------------------------------------------------------------------------
[2006-12-27 22:32:23] katzenmayer at erfnet dot de
Description:
------------
While switching a calendar script from PHP4 to PHP5 I noticed the
script takes multiple times as long to complete in PHP5 than it did in
PHP4.
The problem seems to be date() and mktime() functions.
I did not notice any other PHP5 related performance issues. Scripts
that do not use date() or mktime() run very fast.
Reproduce code:
---------------
test.php:
<?
for ($i=0;$i<100000;$i++)
{
date('d');
}
?>
Now check this script with both PHP4 and PHP5:
time php4 test.php
time php5 test.php
Expected result:
----------------
The script should take about the same time in both PHP4 and PHP5
Actual result:
--------------
time php4 test.php
real 0m0.286s
user 0m0.034s
sys 0m0.252s
time php5 test.php
real 0m25.252s
user 0m18.579s
sys 0m5.615s
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=39968&edit=1[/url]
iliaa@php.net Guest



Reply With Quote

