use constant RECS => 1000000;
{
open my $fh, ">/tmp/bla.xml" or die;
select $fh;
print "\n";
for (1..RECS) {
print <
John Smith
London
EOF
}
print "\n";
}
{
require Storable;
my @addresses;
for (1..RECS) {
push @addresses, { name => "John Smith", city => "London" };
}
Storable::nstore(\@addresses, "/tmp/bla.st");
}
####
$ ( set time = ( 0 "%U+%S %E %MK" ) ; time perl -MStorable -e 'retrieve "/tmp/bla.st"' )
1.980+0.384 0:02.41 193974K
$ ( set time = ( 0 "%U+%S %E %MK" ) ; time perl -MXML::LibXML -e 'XML::LibXML->new->parse_file("/tmp/bla.xml")->documentElement' )
6.037+1.876 0:08.15 643952K