Re: PHP Serialization Performance
| From: | Casey | Date: | Thu, 17 Apr 2008 03:42:36 +0000 |
| Subject: | Re: PHP Serialization Performance | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-273140@lists.php.net to get a copy of this message | ||
On Wed, Apr 16, 2008 at 4:04 AM, Waynn Lue <waynnlue@gmail.com> wrote:
> I'm using PHP to cache files that are backed by the database. In the
> course of writing these functions, I end up with a set of variables
> that are needed by my application, returned in an array. I can either
> directly generate the array in a .php file, then use require_once to
> get that variable, or I can use PHP serialization, write that array
> out to a file, then in my application read the array in, deserialize,
> etc.
>
> I spent awhile trying to look at the performance of php serialization,
> but except for one unsubstantiated comment on the php serialize() doc
> page, I haven't found much. Does anyone have any knowledge of that,
> and also of the two approaches in general? The pro of the
> serialization is that I think it's slightly easier to write, but the
> con is that it's harder to read.
>
> Thanks!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
According to this
(http://us2.php.net/manual/en/function.var-export.php#76099),
serialize is faster than var_export.
--
-Casey