I've posted patch last summer http://www.zend.com/zend/week/pat/pat5.txt
which imporves performance of implode()
function in PHP4, but nobody
doesn't
commit it yet. Can anybody explain the reason?
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alexander Valyalkin schrieb:
I've posted patch last summer http://www.zend.com/zend/week/pat/pat5.txt
which imporves performance ofimplode()
function in PHP4, but nobody
doesn't
commit it yet. Can anybody explain the reason?
After applying the change to ext/standard/string.c in PHP4 the following
Test failed:
Bug #22224 (implode changes object references in array)
[ext/standard/tests/strings/bug22224.phpt]
Regards,
Christian Stadler
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCO0No9250Hcbf/3IRAndDAJ9H9iNnfa1CXegMHWgmyfR0S2QLhwCfSv3F
7pYwoZ8Y9NeFpzrMeuHxue8=
=GtGF
-----END PGP SIGNATURE
After applying the change to ext/standard/string.c in PHP4 the following
Test failed:
Bug #22224 (implode changes object references in array)
[ext/standard/tests/strings/bug22224.phpt]Regards,
Christian Stadler
I understood my fault. I didn't notice condition
if (!(*ppzv)->is_ref) { }
in convert_to_ex_master() macro.
But compare execution time of the following test on PHP4 & PHP5:
<?
function getmicrotime()
{
list($usec, $sec) = explode(" ", microtime()
);
return ((float)$usec + (float)$sec);
}
$t = getmicrotime();
$s = str_repeat('a', 1 << 24);
$a = implode(",", array($s, $s));
echo getmicrotime() - $t;
?>
I think, it will be good idea to fix such time wasting in PHP4.
I've posted patch last summer
http://www.zend.com/zend/week/pat/pat5.txt
which imporves performance ofimplode()
function in PHP4, but nobody
doesn't
commit it yet. Can anybody explain the reason?
Because convert_to_string_ex() modifies the content of every element
that is not of string type.
<?php
$arrays = array(array(), array(), array());
var_dump(implode('', $arrays));
var_dump($arrays);
?>
We already have an optimisation in the 5.x branches.
I think it is appliable to the 4.3 branch.
Moriyoshi
<?php
$arrays = array(array(), array(), array());
var_dump(implode('', $arrays));
var_dump($arrays);
?>We already have an optimisation in the 5.x branches.
I think it is appliable to the 4.3 branch.
4.3 is only for bugfixes!
Derick
--
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org
<?php
$arrays = array(array(), array(), array());
var_dump(implode('', $arrays));
var_dump($arrays);
?>We already have an optimisation in the 5.x branches.
I think it is appliable to the 4.3 branch.4.3 is only for bugfixes!
It didn't mean that the fix should be in the 4.3. What was it
that excited you so much? :)
Moriyoshi
Just make sure that zval's which are isolated with convert_to_string_ex()
are only used as read-only.
At 09:41 PM 3/18/2005 +0300, Alexander Valyalkin wrote:
I've posted patch last summer http://www.zend.com/zend/week/pat/pat5.txt
which imporves performance ofimplode()
function in PHP4, but nobody
doesn't
commit it yet. Can anybody explain the reason?--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/