Rate return no ret return 4682554/s -- -30% no ret 6642457/s 42% -- #### use Benchmark qw( cmpthese ); my %hash = (1, 2, 4, 6, 43, 32, 5, 6, 6, 43, 3, 54, 5, 1); cmpthese(0, { 'return' => sub { return \%hash }, 'no ret' => sub { \%hash }, });