ID: 31332 Updated by: [EMAIL PROTECTED] Reported By: marekm at apnet dot pl Status: Verified Bug Type: Performance problem Operating System: * PHP Version: 4CVS, 5CVS (2005-01-04) New Comment:
Sorry to say... but abusing serialize for this is not a good idea in the first place. It's not meant for storing data in this way in the first place. But of course the slowdown shouldn't have been this much. Previous Comments: ------------------------------------------------------------------------ [2005-01-13 21:11:06] gik at zap dot cl The excessively high load average of a server recently updated to php 4.3.10 was driving me nuts. This bug is critical for many php based systems as drupal, vBulletin and others. Gik. ------------------------------------------------------------------------ [2005-01-10 13:43:52] kier at vbulletin dot com I can confirm this problem from my experience with 4.3.10 and 5.0.3. Unserialize() under the latest versions appears to be massively slower than was previously so. We have had wide reports of vBulletin installations running significantly slower since we recommended that customers upgrade to 4.3.10 / 5.0.3. Hoping for a quick resolution to this problem, as it affects so many people so drastically. ------------------------------------------------------------------------ [2005-01-09 15:11:39] ralf dot praschak at gmx dot net i use vbulletin 3.0.5. the forumcache is also unserialized. i tracked this with the nusphere profiler. with php 4.3.9 (or 5.0.2) it takes around 300ms. with php 4.3.10 (or 5.0.3) it takes 17s and more !!! the cache is around 2.5 megs big ;( ------------------------------------------------------------------------ [2004-12-30 10:13:09] chris-php at bolt dot cx 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. ------------------------------------------------------------------------ [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