Re: [Perlunit-devel] commits
Status: Beta
Brought to you by:
mca1001
From: Adam S. <ad...@sp...> - 2001-11-12 13:33:33
|
Ian Robertson (ia...@ez...) wrote: > >>>>> "AS" == Adam Spiers <ad...@sp...> writes: > AS> While we're at it, another quick poll: > > AS> my $self = shift; > AS> my $arg = shift; > > AS> or > > AS> my ($self, $arg) = @_; > > AS> ? > > AS> IIRC some of my cow-orkers here benchmarked it and found that the > AS> latter was noticeably faster. > > FWIW, on my box, the shift method seems to be a touch faster if there > are one or two arguments (including $self); the @_ method starts to > win at three. However, the difference is in the fraction of a > microsecond range, so it's probably not a deciding factor :). That's odd, my tests show that the more shifts you use, the slower it gets. Try the attached benchmark. It may be something to do with a difference in Perl versions, of course. Mine's 5.6.0. |