Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50710 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92738 invoked from network); 30 Nov 2010 08:27:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2010 08:27:34 -0000 Authentication-Results: pb1.pair.com header.from=doctorrock83@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=doctorrock83@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.177 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: doctorrock83@gmail.com X-Host-Fingerprint: 209.85.216.177 mail-qy0-f177.google.com Received: from [209.85.216.177] ([209.85.216.177:37288] helo=mail-qy0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/72-01713-575B4FC4 for ; Tue, 30 Nov 2010 03:27:34 -0500 Received: by qyk27 with SMTP id 27so5552358qyk.8 for ; Tue, 30 Nov 2010 00:27:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type; bh=Y7HKJb9iaRYAUkLxuZf7ZfXd7RltNRCkD+RGErQ1oTY=; b=tguFB5dRgzFziGYg6OZnmYSUWfvHJc6FjM5Eyw5UPZEJTQRsn9kh6XvJEZGCkHbj1U 0Ln3PbtGbE7Ti+fTaHCOuch8u5NgNm88A6LtWBsMHbFYOgA7VmrX9i5fMsCg0qLQfBHq udpgxPrGt7hbVOYTQ+WiKcXcgEkFbmZLxzhTM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=wtz0dccVfrASpbTwj0OwRB3AKu4R2NO0/ncIRvPxqO+am5OYqI9UAV0YWLL6ao/DSP OoUWAijWJpj7F9ZsmNWfK3rDKw4n78A5lwTfVqeQT5Gt0MTVZC8e+Ce+BRpWSgFtjukI /pMwqdMrRGlpbo5YeGzYcHz1h4qDOjdymoe64= Received: by 10.224.67.75 with SMTP id q11mr6486177qai.3.1291105651767; Tue, 30 Nov 2010 00:27:31 -0800 (PST) MIME-Version: 1.0 Sender: doctorrock83@gmail.com Received: by 10.220.102.72 with HTTP; Tue, 30 Nov 2010 00:26:51 -0800 (PST) In-Reply-To: <006f01cb8f17$725bcdf0$571369d0$@com> References: <8757232E56758B42B2EE4F9D2CA019C9154CB7@US-EX2.zend.net> <006f01cb8f17$725bcdf0$571369d0$@com> Date: Tue, 30 Nov 2010 09:26:51 +0100 X-Google-Sender-Auth: 0WbWIem7Bo_vd_IuXjH42QbtZOE Message-ID: To: Jonathan Bond-Caron Cc: Andi Gutmans , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Performance of buffer based functionality (JSON, AES, serialize()) From: jpauli@php.net (Julien Pauli) 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 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 > >