use Benchmark qw(cmpthese);
cmpthese( 10_000,
{
'From Cache' => sub{ $link->_load_from_cache ( $criteria ); },
' From DBI' => sub{ $link->_load_from_database( $criteria ); }
}
);
####
Benchmark: timing 10000 iterations of From DBI, From Cache...
From DBI: 16 wallclock secs (13.66 usr + 1.50 sys = 15.16 CPU) @ 659.63/s (n=10000)
From Cache: 16 wallclock secs ( 6.86 usr + 0.75 sys = 7.61 CPU) @ 1314.06/s (n=10000)
Rate From DBI From Cache
From DBI 660/s -- -50%
From Cache 1314/s 99% --
####
--
tidiness is the memory loss of environmental mnemonics