Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50666 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66600 invoked from network); 28 Nov 2010 16:15:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2010 16:15:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:64008] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/D7-16104-A1082FC4 for ; Sun, 28 Nov 2010 11:15:26 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id DA07F5D36; Sun, 28 Nov 2010 11:15:17 -0500 (EST) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3w-7FzDimF8A; Sun, 28 Nov 2010 11:15:17 -0500 (EST) Received: from djbondc (modemcable083.208-56-74.mc.videotron.ca [74.56.208.83]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 8C8585D16; Sun, 28 Nov 2010 11:15:17 -0500 (EST) To: "'Andi Gutmans'" , References: <8757232E56758B42B2EE4F9D2CA019C9154CB7@US-EX2.zend.net> In-Reply-To: <8757232E56758B42B2EE4F9D2CA019C9154CB7@US-EX2.zend.net> Date: Sun, 28 Nov 2010 11:15:16 -0500 Message-ID: <006f01cb8f17$725bcdf0$571369d0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuMyKPxquXeaFi0QPSLqa5adhX35wBveJmA Content-Language: en-ca x-cr-hashedpuzzle: AVcx BdBm B4tg CPLl FVmm Ii/z MsAP M1LD OLDF PMHb QIo5 Twid UdV8 VLNJ Vs7r Xobj;2;YQBuAGQAaQBAAHoAZQBuAGQALgBjAG8AbQA7AGkAbgB0AGUAcgBuAGEAbABzAEAAbABpAHMAdABzAC4AcABoAHAALgBuAGUAdAA=;Sosha1_v1;7;{42C7C0A5-B327-4F17-BEA2-75C2038AE391};agBiAG8AbgBkAGMAQABvAHAAZQBuAG0AdgAuAGMAbwBtAA==;Sun, 28 Nov 2010 16:15:09 GMT;UgBFADoAIABbAFAASABQAC0ARABFAFYAXQAgAFAAZQByAGYAbwByAG0AYQBuAGMAZQAgAG8AZgAgAGIAdQBmAGYAZQByACAAYgBhAHMAZQBkACAAZgB1AG4AYwB0AGkAbwBuAGEAbABpAHQAeQAgACgASgBTAE8ATgAsACAAQQBFAFMALAAgAHMAZQByAGkAYQBsAGkAegBlACgAKQApAA== x-cr-puzzleid: {42C7C0A5-B327-4F17-BEA2-75C2038AE391} Subject: RE: [PHP-DEV] Performance of buffer based functionality (JSON, AES, serialize()) From: jbondc@openmv.com ("Jonathan Bond-Caron") 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