#!/usr/bin/perl use strict; use warnings; use diagnostics; use Benchmark qw(:all); my %test = ( sup => [ { name => 'Fooname', ident => 'foo', }, { name => 'barname', ident => 'bar', }, ], ); print cmpthese(1000_000, { 'map+grep' => sub { my ($match) = map{$_->{name}} grep{$_->{ident}eq'bar'} @{$test{sup}}; }, 'map list' => sub { my ($match) = map{$_->{ident}eq'bar'?($_->{name}):()} @{$test{sup}}; }, }); __END__ Rate map+grep map list map+grep 529661/s -- -7% map list 572410/s 8% --