in reply to Re^3: Is there any (performance) benefit to importing functions?
in thread Is there any (performance) benefit to importing functions?
but holy crap coderef!
That case isn't really equivalent to the others - the exported and fullname cases have an extra sub { } wrapped around them.
use warnings; use strict; use Benchmark qw/cmpthese/; sub foo { 1+2==3 } cmpthese(1e8, { one => \&foo, two => sub { foo() }, }); __END__ Rate two one two 24271845/s -- -72% one 86956522/s 258% --
|
|---|