ID:               38812
 User updated by:  chad at herballure dot com
-Summary:          array_key_exists is ~16x slower than 5.1.x
 Reported By:      chad at herballure dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Performance problem
 Operating System: Linux (SuSE 9.2)
 PHP Version:      5CVS-2006-09-13 (snap)
 New Comment:

Your claim that the link "doesn't work" could not be verified. It
displays the PHP script source code to reproduce the bug, as intended.
We do not feel that running the benchmark and producing the output on
our server is useful.

The code available at the link has been updated to no longer require
PEAR. http://www.sapphirepaw.org/ake_bug.txt

New expected and actual results were generated using this code,
revealing an actual difference between PHP versions of 204x.

Because isset() is a language feature, not a function call, an extra
test was added to determine if function calls are what is expensive.
The answer appears to be "no".

New expected result:
--------------------
ake_test:
Array
(
    [0] => 0.297938108444
    [1] => 0.211642026901
    [2] => 0.16384100914
    [3] => 0.153891801834
)
is1_test:
Array
(
    [0] => 0.193047046661
    [1] => 0.176480054855
    [2] => 0.168280124664
    [3] => 0.171167135239
)
is2_test:
Array
(
    [0] => 0.111315965652
    [1] => 0.112279176712
    [2] => 0.105856180191
    [3] => 0.109282016754
)

New actual result:
------------------
ake_test:
Array
(
    [0] => 36.2062079906
    [1] => 36.0692551136
    [2] => 36.0703611374
    [3] => 36.040956974
)
is1_test:
Array
(
    [0] => 0.17557311058
    [1] => 0.169100999832
    [2] => 0.169121026993
    [3] => 0.169019937515
)
is2_test:
Array
(
    [0] => 0.113948106766
    [1] => 0.108880996704
    [2] => 0.107892036438
    [3] => 0.110790014267
)


Previous Comments:
------------------------------------------------------------------------

[2006-09-13 17:01:31] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

The URL you provided doesn't work.
And please don't provide test cases that require PEAR.
Thank you.

------------------------------------------------------------------------

[2006-09-13 15:58:57] chad at herballure dot com

Description:
------------
array_key_exists takes about 16 times longer in PHP 5.2-200609131430
than it does in 5.1.[246].

Reproduce code:
---------------
http://www.sapphirepaw.org/ake_bug.txt
(depends on Benchmark_Iterate in PEAR)

Expected result:
----------------
The 5.1.x series produces numbers like:
ake_test:
Array
(
    [0] => 0.406023979187
    [1] => 0.285789966583
    [2] => 0.236785173416
    [3] => 0.22957110405
)


Actual result:
--------------
Yesterday's and todays 5.2 snapshots produce numbers like:
ake_test:
Array
(
    [0] => 4.45166897774
    [1] => 4.08239388466
    [2] => 4.0640411377
    [3] => 4.06054711342
)



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38812&edit=1

Reply via email to