Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47403 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22394 invoked from network); 18 Mar 2010 16:55:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Mar 2010 16:55:31 -0000 Authentication-Results: pb1.pair.com header.from=ben.demott@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=ben.demott@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.191 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ben.demott@gmail.com X-Host-Fingerprint: 209.85.216.191 mail-px0-f191.google.com Received: from [209.85.216.191] ([209.85.216.191:51538] helo=mail-px0-f191.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/8B-20429-00B52AB4 for ; Thu, 18 Mar 2010 11:55:30 -0500 Received: by pxi29 with SMTP id 29so165977pxi.7 for ; Thu, 18 Mar 2010 09:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=jXLOAoLyLAAoFn0/mqCq7uSDmPWZb9XzUz0Pu71N73Y=; b=qo6+1fksoUsjJ1CS2quDJLBd35Rr6s2gYLJmH0rZ+6lTKHaST1IqPjpVrsyAmn6Mon Cj2o+L7dCRkAof0Cp21iBeRY74EPLYcqbrNFOa0NxE2qB6HVmrMIWBes4kZsDuV5YCsz 3EubEtMnpRZsdhxexc4XBrnIoAishR75kcM/A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=nOPuLEEJsgKoPR10C7xpOboLEFOgt92ZEDh0aoRXnhqVJxF9xxBP/pK0KCJxKG2wMg phZwCTxnw5I95fJQsmxFNONWnV25ilInHlJZpIuP7BiyTgiwpors9I+QcnOeV2+DAGeV gfg5PuvjJmKQE1SPtsWV/l+HlzrB0AET85PCU= MIME-Version: 1.0 Received: by 10.143.20.13 with SMTP id x13mr1426585wfi.225.1268931321308; Thu, 18 Mar 2010 09:55:21 -0700 (PDT) In-Reply-To: References: <56.96.20429.EC352AB4@pb1.pair.com> Date: Thu, 18 Mar 2010 12:55:21 -0400 Message-ID: <99828cd71003180955k48ae834flb8ad2c55b5001692@mail.gmail.com> To: Derick Rethans Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] PHP Variable Storage / DBUS From: ben.demott@gmail.com (Ben DeMott) Thanks for the response Derick, So is the data structure thats being serialized remaining in some form thats reflective of its binary encoding on the system. Or is there some byte-encoding that goes on to generalize the binary structure? I guess ... Does it find the values in memory of the distinct values, and then create a serialized set of indexes in a c-compatible data-type? or... is this just another form of string serialization, where variables are represented by strings encoded in ASCII? If this is a binary serialization two additional questions: 1.) Does this mean that you can to some accuracy determine the size of an in-memory variable by counting the sizeof() on the components that make up the data-structure in C? 2.) Can the PHP sessions serialization be made to use this type of serialization - so the serialized values could be shared between multiple applications.. (let me give you an example) Would I be better off just re-implementing the PHP C code for its session serializer/deserializer in Python than attempting to keep it binary? For PHP Sessions, lets say you use memcached to store a serialized representation of the session. Lets also say that you would like to read that session data occasionally by python to offload work that your webserver would normally have to perform. If you were to write a binary serialized form to memory - the C implementation of the serialization could by very easily ported to Python as an extension and both could be maintained with ease (as both PHP and Python are written in C, a Java variant wouldn't be too hard either using JNI) I guess this brings up the question of - How hard would it be to expose the binary object that dbus sends over-the-wire so it could be written to file instead? Overall it would be nice if PHP had a functionality similar to Pythons Pickle -> to expose to the user so they could store binary representations of objects as they saw fit. It seems to me this would be vastly more efficient than an ascii-encoding and serialization as well. If my logic is poorly formed because of a lack of understanding please feel free to educate me! Thanks Again Derick - Cheers!