another option is XML::Dumper. it's much slower, even then Storable, but it shares all of the same benefits as Storable mentioned by Jose ( and i'll second that the fetch/store will possibly be a bigger bottle neck then the serialize/deserialize too) but also has the advantage of storing in a human readable format, and that's useful for debuging.

here's the results w/ e = XML::Dumper, but with freeze and pl2xml moved into the comparison functions as well (for a round-trip idea, fwiw) ---------

shift8@2axxon:~$ perl t.pl Benchmark: running a, b, c, d, e for at least 1 CPU seconds... a: 1 wallclock secs ( 1.14 usr + 0.00 sys = 1.14 CPU) @ 25 +784.21/s (n=29394) b: 1 wallclock secs ( 1.09 usr + 0.00 sys = 1.09 CPU) @ 32 +879.82/s (n=35839) c: 1 wallclock secs ( 1.05 usr + 0.01 sys = 1.06 CPU) @ 46 +10.38/s (n=4887) d: 1 wallclock secs ( 1.05 usr + 0.00 sys = 1.05 CPU) @ 42 +65.71/s (n=4479) e: 1 wallclock secs ( 1.04 usr + 0.00 sys = 1.04 CPU) @ 32 +2.12/s (n=335) Rate e d c a b e 322/s -- -92% -93% -99% -99% d 4266/s 1224% -- -7% -83% -87% c 4610/s 1331% 8% -- -82% -86% a 25784/s 7905% 504% 459% -- -22% b 32880/s 10107% 671% 613% 28% -- <perldata> <hashref memory_address="0x82252f8"> <item key="1"> <arrayref memory_address="0x814bc28"> <item key="0">123</item> <item key="1">456</item> <item key="2">678</item> </arrayref> </item> <item key="2">value_2</item> <item key="3">value_3</item> <item key="4">value_4</item> <item key="5">value_5</item> <item key="6">value_6</item> <item key="7">value_7</item> <item key="8">value_8</item> </hashref> </perldata>

In reply to Re^2: Benchmark on deserializing data by shift8
in thread Benchmark on deserializing data by RL

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.