@a = 1 .. 1e6; cmpthese -1, { a=>q[ my $total = sum @a; ], b=>q[ my $total = 0; $total += $_ for @a ], };; Rate b a b 10.8/s -- -73% a 40.9/s 277% --