ID: 31332
Comment by: chris-php at bolt dot cx
Reported By: marekm at apnet dot pl
Status: Open
Bug Type: Performance problem
Operating System: Win32/Linux
PHP Version: 4.3.10
New Comment:
Pretty sure we're getting hit by this as well. We use serialize a lot
(memcached), and upgrading from PHP 4.3.9 to 4.3.10 tripled our
servers' load averages.
Previous Comments:
------------------------------------------------------------------------
[2004-12-29 12:30:09] marekm at apnet dot pl
Description:
------------
I keep big multidimensional arrays serialize()'d into strings in
database.
After upgrade from 4.3.9 -> 4.3.10 I noticed, that unserialize()
function on some of them work even 20 times slower. On other the
slowdown is minimal.
Reproduce code:
---------------
<?
function getmicrotime()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$f=fopen("serialized.txt","r");
$l1=fgets($f,1000000);
fclose($f);
$t1=getmicrotime();
$a=unserialize($l1);
echo(getmicrotime()-$t1);
?>
The tested "serialized.txt" file can be downloaded from
http://ap.aptus.pl/serialized.txt
Expected result:
----------------
The above script working as fast as in 4.3.9
Actual result:
--------------
The script works about 20x slower.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31332&edit=1