ID: 31332 Comment by: dondop at gmail dot com Reported By: marekm at apnet dot pl Status: Verified Bug Type: Performance problem Operating System: * PHP Version: 4CVS, 5CVS (2005-01-04) New Comment:
It has been quite some time now and this is really an important bug to fix. I understand that open source means that development is done when someone feels like it, but as this is crumbling big shared hosting solutions where sites run on this PHP which use unserialize() I really a fix is developed soon. Comon devs, wake up and smell some coffee :) Previous Comments: ------------------------------------------------------------------------ [2005-01-14 14:40:52] john at jelsoft dot com I would agree with what Gik just said. To quote from the PHP manual: "serialize -- Generates a storable representation of a value" Or later: "serialize() returns a string containing a byte-stream representation of value that can be stored anywhere. This is useful for storing or passing PHP values around without losing their type and structure." I tried some comparisons a while back on different ways to store PHP array data in a DB. I tried storing it in a form where I could run eval($data) and it turned out to be a lot slower than unserialize($data). (Perhaps this would be different given this bug). serialize() seems to be ideal for this situation where large array or object data is to be stored in a DB or shm. So I was surprised that the usages outlined above are 'abuses', as they seem to be using serialize() for exactly what it was intended for. Perhaps the manual needs clarifying if this isn't the case? ------------------------------------------------------------------------ [2005-01-14 13:52:06] gik at zap dot cl As far as I know, objects stored in shared memory using shm_put_var() are stored serialized. I haven't looked at the sources yet, but the problem affecting unserialize() should also degrade the performance of shm_put_var() which is vastly used to store arrays or other objects in shared memory for _quick_ access. I don't know if there are other functions which use this method internally. I wouldn't call it an abuse to serialize and store an array with 1000 elements in shm, as this is a very efficient way to do data caching. The performance degradation is large enough to make a web server collapse, because of the extra time required to process each request. ------------------------------------------------------------------------ [2005-01-14 09:05:51] [EMAIL PROTECTED] 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. ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/31332 -- Edit this bug report at http://bugs.php.net/?id=31332&edit=1