Yves said that the XS version of Data::Dumper was inefficient because
it keeps triggering realloc() due to sv_cat(). Here's a rather brute
force approach to pre-stretching the buffer - if there are less than
40 bytes free, grow it by 50%.
Surprisingly effective for my test program
./perl -Ilib -MData::Dumper -MStorable=retrieve -we \
'print Dumper(retrieve(shift))' ~/.cpan/Metadata >/dev/null
Before
real 2m42.921s
user 1m43.321s
sys 0m55.611s
After
real 0m5.205s
user 0m4.885s
sys 0m0.255s
Same 25M of output, byte for byte. :-)
p4raw-id: //depot/perl@28963