#! perl -slw use strict; use Benchmark qw[ cmpthese ]; our $o = bless { X=>1 }, 'main'; sub getX1{ my $self = shift; return $self->{X}; } sub getX2{ return $_[0]->{X}; } sub getX3{ $_[0]->{X}; } cmpthese -1, { A=> q[ my $x = $o->getX1(); ], B=> q[ my $x = $o->getX2(); ], C=> q[ my $x = $o->getX3(); ], }; __END__ C:\test>junk19 Rate A B C A 1441709/s -- -11% -20% B 1611352/s 12% -- -10% C 1797147/s 25% 12% --