Rate total_size storable total_size 4.04/s -- -70% storable 13.5/s 234% -- #### use Benchmark qw(:all); use Devel::Size; use Storable; sub _storable_size { open(my $fh, '|-', 'cat > /dev/null'); Storable::store_fd $_[0], $fh; tell($fh); } my $o; $o->{$_} = rand() foreach ( 'a' .. 'z' ); my $hash; $hash->{$_} = $o foreach ( 0 .. 100_000 ); cmpthese( 100, { 'total_size' => sub { Devel::Size::total_size( $hash ) }, 'storable' => sub { _storable_size( $hash ) }, });