Substantially faster.

#!/usr/bin/perl package My; use strict; use lib qw(/home/snowhare/modules/Sub-Parms/Sub-Parms-1.00/lib); use Sub::Parms qw(:validate); use Class::ParmList qw (simple_parms); use Params::Validate qw (validate); use Benchmark qw(cmpthese); cmpthese(200000, { 'sub_parms_method' => sub { sub_parms_method( 'ClassName', + handle => 'Test', 'thing' => 'something')}, 'sub_parms_function' => sub { sub_parms_function( handle = +> 'Test', 'thing' => 'something')}, 'sub_parms_bind_parms_function' => sub { sub_parms_bind_pa +rms_function( handle => 'Test', 'thing' => 'something')}, 'sub_parms_bind_parms_function_req' => sub { sub_parms_bin +d_parms_function_req( handle => 'Test', 'thing' => 'something')}, 'standard_args' => sub { standard_args( handle => 'Test +', 'thing' => 'something')}, 'cf_standard_args' => sub { cf_standard_args( handle => 'T +est', 'thing' => 'something')}, 'one_step_args' => sub { one_step_args( handle => 'Test +', 'thing' => 'something')}, 'positional_args' => sub { positional_args( 'Test', 'some +thing')}, 'null_sub' => sub { null_sub( handle => 'Test', 't +hing' => 'something')}, 'null_method' => sub { null_method( handle => 'Test', + 'thing' => 'something')}, 'simple_parms' => sub { simple_parms_args( handle => ' +Test', 'thing' => 'something')}, 'params_validate' => sub { params_validate( handle => 'Te +st', 'thing' => 'something')}, } ); exit; ###################################################################### +###### sub params_validate { my ($handle, $thing) = @{(validate(@_, { handle => 1, thing => 1 } +))}{'handle','thing'}; } sub sub_parms_method { MethodParms := $self, %args; my ($handle, $thing) = @args{'handle','thing'}; } sub sub_parms_function { ParmsHash := %args; my ($handle, $thing) = @args{'handle','thing'}; } sub sub_parms_bind_parms_function { BindParms : ( my $handle := handle; my $thing := thing; ) } sub sub_parms_bind_parms_function_req { BindParms : ( my $handle := handle [required]; my $thing := thing [required]; ) } sub simple_parms_args { my ($handle, $thing) = simple_parms(['handle','thing'], @_); } sub positional_args { my ($handle, $thing) = @_; } sub one_step_args { my %args = @_; my ($handle, $thing) = @args{'handle','thing'}; } sub cf_standard_args { my %args; { my %raw_args = @_; %args = map { lc($_) => $raw_args{$_} } keys %raw_args; } my ($handle, $thing) = @args{'handle','thing'}; } sub standard_args { my %args = @_; my ($handle, $thing) = @args{'handle','thing'}; } sub null_sub { } sub null_method { }
Rate simple_parms 28329/s params_validate 48077/s cf_standard_args 73529/s sub_parms_bind_parms_function_req 157480/s sub_parms_bind_parms_function 172414/s one_step_args 224719/s standard_args 229885/s sub_parms_method 238095/s sub_parms_function 270270/s positional_args 952381/s null_method 1666667/s null_sub 1666667/s

In reply to Re^2: When is it better to NOT release a new module? by snowhare
in thread When is it better to NOT release a new module? by snowhare

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.