2009/10/30 Raphael Manfredi <Raphael_Manfredi@pobox.com>: > Quoting Tim Bunce <Tim.Bunce@pobox.com> from ml.lang.perl.porters: > :On Thu, Oct 29, 2009 at 07:47:45PM +0000, Raphael Manfredi wrote: > :> If JSON does not handle circular references, then you save one hash > :> table lookup per object serialized. The difference is going to be > :> significant if you serialize many objects. > : > :I think Storable does a lot more extra work than that to handle graphs > :without duplicating the data. > > Not really. Most of the extra overhead is going to be this hash lookup, > all other things being equal. > > Both algorithms are going to handle the data types in the same manner, > roughly speaking. Sure, Storable handles much more situations, but if > you compare simple data structures made of plain scalars, arrays and hash > tables with no references and no magic, then most of the sophisticated > code of Storable is going to be ignored (by design). The extra bit tests > on the SV are not significant. > > In the end, the speed difference between JSON::XS and Storable is going > to be that extra hash table lookup used to remember objects so that > references be kept properly (shared objects remaining shared accross a > serialization and deserialization). It is not just a lookup tho, it is also a store right? IMO that is where a DAG serializer wins. cheers, Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"Thread Previous | Thread Next