develooper Front page | perl.perl5.porters | Postings from October 2009

Re: Is there something faster than Storable?

Thread Previous | Thread Next
From:
demerphq
Date:
October 31, 2009 04:14
Subject:
Re: Is there something faster than Storable?
Message ID:
9b18b3110910310414i52363d81m652a30273271ad32@mail.gmail.com
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About