Re: [PHP4BETA] Serialization efficiency

From: Date: Sat, 12 Jun 1999 12:17:40 +0000
Subject: Re: [PHP4BETA] Serialization efficiency
References: 1 2  Groups: php.version4 
Request: Send a blank email to php-version4+get-1528@lists.php.net to get a copy of this message
On Sat, Jun 12, 1999 at 03:02:22PM +0300, Zeev Suraski wrote: > On Sat, 12 Jun 1999, Sascha Schumann wrote: > > > On Sat, Jun 12, 1999 at 02:42:50PM +0300, Zeev Suraski wrote: > > > On Sat, 12 Jun 1999, Stig Bakken wrote: > > > > > > > As long as the data can be written and read on different-endian machines, > > > > I don't mind. But what about optimizing the serialisation code instead > > > > (perhaps by using a binary but network-byte-order format)? > > > > > > Huh? Why bother at all with caring about endians here? If you worry > > > about this stuff you also worry about number of bits in the platform and > > > God knows what else. > > > > What do you want to do? I don't see much space for optimizing, > > despite packing the length and the type identifier together. > > What do you mean? > When I say we should write binary data, I pretty much mean > fwrite(&p, sizeof(pval), 1, fp). If you want to worry about endians and > bit sizes, you have to go through the data and reverse the order of bytes > on platforms which are reversed from your 'standard' platform (with > endians) and pack stuff up (with platforms that have different bit sizes). > Both seem plane wrong when you never really use the same data on different > platforms. Binary format for IS_LONG and IS_DOUBLE? Is that meant serious? A long here needs 8 bytes to be stored completely (uncompressed). If you don't use scientific large numbers within your PHP application, this will grow the size needed for storing numbers since the ASCII representation is usually much shorter. -- Regards, Sascha Schumann Consultant

« previous php.version4 (#1528) next »