in reply to When every microsecond counts: Parsing subroutine parameters

I think there might be a small mistake in one of your examples.

The entire point of doing "my %args = @_" is that you then don't HAVE to extract them to their own variables. Granted, you pay incrementally per invocation of $args{...} but you don't pay for the ones you don't use. And if you only use a param once, it's cheaper than allocating it to a variable.

So the slice and allocation you have there is probably superfluous

Named params is also a good way to support subclassing, because you don't have to co-ordinate with child classes.

You just $self->SUPER::method(@_) or $self->SUPER::method(%args);

I'll also note that, for a number of position params two or smaller, it's faster to have two separate "my $var = shift;" calls than one "my ($var, $var) = @_;" call.
  • Comment on Re: When every microsecond counts: Parsing subroutine parameters