in reply to Using bytecode for object serialization

Storable is going to be fast as you can get I think. Data::Dumper is a horribly inefficient representation. Id be interested to see some benchmarks of the performance differences between Dumper, Storable and YAML.

Im betting Storable creams the other two big time.


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi


Replies are listed 'Best First'.
Re: Re: Using bytecode for object serialization
by Starky (Chaplain) on Sep 27, 2003 at 21:26 UTC
    Although Data::Dumper is by far slower than Storable because it endeavors to dump data structures in human- and perl-readable form, it does offer an advantage in that if you are freezing the structures to a database and/or flat file and the data structure becomes corrupted for some reason, you can visually reconstruct them.

    This is not a hypothetical case. I have been involved in two such situations, once because one of the Oracle datatypes likes to strip trailing whitespace from a string. A very obscure but, in this case, important piece of information that was not discovered until code was pushed to the production environment.

      Absolutely Data::Dumper has its place. I swear by it. (And am writing and have written several versions of different flavours, none as good :-) By horribly inefficient I meant the process of dumping and of parsing. The fact that it performs so well was suprising to me. The fact that it only took twice as long to load as Storable is a good comment on the quality of perls parsing.

      However I'm willing to bet good money that the dump times showed Storable doing much better.

      Of course this doesn't address your point about Data::Dumper as a development and debugging tool in the slightest. There it is very useful indeed.

      ---
      demerphq

        First they ignore you, then they laugh at you, then they fight you, then you win.
        -- Gandhi