[Fwd: Re: [PEAR-DEV] Re: unserialize() bottle-neck]
| From: | Lukas Smith | Date: | Wed, 12 Jan 2005 08:06:05 +0000 |
| Subject: | [Fwd: Re: [PEAR-DEV] Re: unserialize() bottle-neck] | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-35455@lists.php.net to get a copy of this message | ||
-------- Original Message --------
Subject: Re: [PEAR-DEV] Re: unserialize() bottle-neck
Date: Sun, 11 Jan 2004 19:16:17 -0500
From: Louis Mullie <louis@mulliemedia.com>
To: Lukas Smith <lsmith@php.net>
References: <41E455FB.3020905@nerim.net> <41E456F5.7030407@php.net>
Lukas Smith wrote:
Olivier Guilyardi wrote:an object with such properties. Using a few hacks, I was able to write successfully a simple serializer, but it was still slower than the PHP's serialize() function. Here are the results of a basic benchmark I did : Using custom serializer : serialize/unserialize time 0.000229120254517 secs Using built-in serializer : serialize/unserialize time 0.000040054321289 secs Regards, Louis Mullie -- Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07Gz compression is turned off, so unserialize() eats 59,49 % of runtime. Have you ever encountered such optimization problems with serialize()/unserialize() ? I quite understand that unserializing a 150ko string (the index) into an array take some time, but how to optimize that ? Should I try to write my own (un)serializer ? What about using a binary format which would save disk space as well ? Any experiences welcome,I remember Wez once saying that he either wrote a faster serialize() or unserialize() in PHP itself .. regards Lukas PHP5's protected/private identifiers make it very difficult to serialize