Re: Performance of buffer based functionality (JSON, AES, serialize())
| From: | Julien Pauli | Date: | Tue, 30 Nov 2010 08:26:51 +0000 |
| Subject: | Re: Performance of buffer based functionality (JSON, AES, serialize()) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50710@lists.php.net to get a copy of this message | ||
I guess serialize mechanism cant use any char that can be part of a
PHP variable. And "_" can. As property names respect binary
compatibility, the only char that can be used to mark private
properties is actually the NULL byte. Ping me if I'm wrong.
But I'm +1 for improving the serialize() speed, I had problems
recently with it, and igbinary came to save me as well :)
Julien.Pauli
On Sun, Nov 28, 2010 at 5:15 PM, Jonathan Bond-Caron <jbondc@openmv.com> wrote:
> On Thu Nov 25 12:47 PM, Andi Gutmans wrote:
>>
>> I know there have been some high-end apps that have benefited from
>> some custom serializers, etc... (typically platform dependent).
>> I wonder if people here think improvements in these areas would move
>> the needle for the majority of mainstream apps or not.
>>
>
> Like people have mentioned, improving (un)serialize speed would be a huge
> benefit, especially for caching data sets or large objects.
>
> From experience, it would seem valuable to have:
> 1) serialize_text($var)
>
> The existing serialize() minus the NULL bytes on private properties. It has
> been a source problems for developers serializing an object with private
> properties and storing it in a database (the string may get cutoff).
>
> I'm not sure why there's a NULL byte in 'zend_mangle_property_name',
> instead
> the char "_" could be used to mark a private property in the serialized
> text.
> The unserialize could be BC compatible accepting both NULL and "_" around a
> private property.
>
> 2) serialize_binary($var)
>
> An efficient and compact serialization using techniques from igbinary.
>
> A potential problem with igbinary I've noticed is it packs a double as a 64
> bit integer.
> That could be a problem if you serialize on a platform that has an IEEE 754
> binary representation and unserialize on a non-IEEE platform but I don't
> know if php compiles on architectures that are non-IEEE.
>
> It could also be interesting to pack integers as varints:
>
> http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints
>
> http://protobuf-c.googlecode.com/svn/trunk/src/google/protobuf-c/protobuf-c.
> c
>
> That's most likely slower though then what igbinary does with integers
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>