Help for this page
use strict; use Benchmark qw(cmpthese); ... for_loops => sub { for(@a1) { $_ = $_ + 1 } }, map_loops => sub { map { $_ = $_ + 1 } @a1 }, });
Rate map_loops for_loops map_loops 499/s -- -40% for_loops 835/s 67% --