use strict; use warnings; use Benchmark qw( cmpthese ); sub foo { @_ } my $ref = \&foo; cmpthese(-2, { refcall => sub { @_=(1); $ref->(@_) }, named => sub { @_=(1); foo(@_) }, g_scalar => sub { @_=(1); goto $ref }, g_amp => sub { @_=(1); goto &$ref }, }); #### Rate named refcall g_amp g_scalar named 811837/s -- -1% -3% -26% refcall 820126/s 1% -- -2% -25% g_amp 834174/s 3% 2% -- -24% g_scalar 1099304/s 35% 34% 32% --