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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |