use Benchmark qw/:all/; @lrg_hash{ 0 .. 20000 } = (); @sml_hash{ 0 .. 10 } = (); $sml_hash{ 5000 } = undef; # Create a hash key of the same name in # %sml_hash as in %lrg_hash. cmpthese ( 500000, { Big => '$lrg_hash{5000}=1;', Little => '$sml_hash{5000}=1;' } ); __OUTPUT__ Rate Big Little Big 378788/s -- -1% Little 381679/s 1% --