Re: [PHP4BETA] Serialization efficiency

From: Date: Sat, 12 Jun 1999 12:02:22 +0000
Subject: Re: [PHP4BETA] Serialization efficiency
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-1525@lists.php.net to get a copy of this message
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. Zeev -- ----------------------------------------------------- Zeev Suraski <zeev@zend.com> For a PGP public key, finger bourbon@netvision.net.il

« previous php.version4 (#1525) next »