#14237 [Opn->Bgs]: reference calls in some cases very slow
| From: | andrey@php.net | Date: | Sat, 04 Jan 2003 17:37:14 +0000 |
| Subject: | #14237 [Opn->Bgs]: reference calls in some cases very slow | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-29053@lists.php.net to get a copy of this message | ||
ID: 14237
Updated by: andrey@php.net
Reported By: alberty@neptunelabs.com
-Status: Open
+Status: Bogus
Bug Type: Performance problem
Operating System: i686-pc-linux-gnu
PHP Version: 4.1.0
New Comment:
I modified the script a bit by adding var_dump(microtime())
around the function calls. The output :
With reference:
string(21) "0.58075200 1041701482"
string(21) "0.20217700 1041701490"
Without reference:
string(21) "0.20247500 1041701490"
string(21) "0.20739800 1041701490"
as everyone may see without reference is faster as it has to be
(according to some docs). I think that there is something wrong in the
way the script computes the time.
Ooops, I found it :
$tmp = explode(' ', microtime());
$measure['Start Reference']=(double)$tmp[0] + (double)$tmp[1];
the indexes are swapped must be
$measure['Start Reference']=(double)$tmp[1] + (double)$tmp[0];
Closing this.
Previous Comments:
------------------------------------------------------------------------
[2002-01-31 05:12:55] bs_php@infeer.com
I did some benchmark tests on loops and so that also delever some
strange results.
See it run at: http://phpxpath.sourceforge.net/benchmark/phpBench.php
Code at: http://phpxpath.sourceforge.net/benchmark/phpBench.php.txt
------------------------------------------------------------------------
[2001-12-13 04:47:07] alberty@neptunelabs.com
I think, this is an very annoying behavior of the zend engine and also
there are no warning or clue in the documentation.
Someone must change it.
------------------------------------------------------------------------
[2001-12-12 20:06:28] mfischer@php.net
That's a known issue with the current Zend Engine.
We could move it to a ZE feature request, but will it change anything
soon? I doubt ...
------------------------------------------------------------------------
[2001-12-12 19:59:37] yohgaki@php.net
PHP Version updated to 4.1.0
------------------------------------------------------------------------
[2001-12-12 19:58:57] yohgaki@php.net
Output from Linux Celeron 433/384MB/PHP 4.1.0/Apache 1.3.22.
Loopcount: 100
String size: 1048576
Time for function request "with_reference" : 1.6308959722519 secs
Time for function request "without_reference": 0.0011709928512573
secsexecution time of without_reference is 1393 times fast as
with_reference!
There must be something wrong....
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/14237
--
Edit this bug report at http://bugs.php.net/?id=14237&edit=1