in reply to Re^2: Is there any (performance) benefit to importing functions?
in thread Is there any (performance) benefit to importing functions?

Thanks choroba!

So export and fullname are negligibly different, but holy crap coderef! :)

  • Comment on Re^3: Is there any (performance) benefit to importing functions?

Replies are listed 'Best First'.
Re^4: Is there any (performance) benefit to importing functions?
by haukex (Archbishop) on Feb 10, 2018 at 23:04 UTC
    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% --