From: marekm at apnet dot pl
Operating system: Win32/Linux
PHP version: 4.3.10
PHP Bug Type: Performance problem
Bug description: unserialize() works terribly slow on huge strings compared to
4.3.9
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 bug report at http://bugs.php.net/?id=31332&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31332&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31332&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31332&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31332&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31332&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31332&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31332&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31332&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31332&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31332&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31332&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31332&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31332&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31332&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31332&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31332&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31332&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31332&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31332&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31332&r=mysqlcfg