Perinci-Sub-Wrapper

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    and do not want to repeat validating result. E.g. used if you use
    Dist::Zilla::Plugin::Rinci::Validate.

  x.perinci.sub.wrapper.logs => array
    Generated/added by this module to the function metadata for every
    wrapping done. Used to avoid adding repeated code, e.g. to validate
    result or arguments.

PERFORMANCE NOTES
    The following numbers are produced on an Intel Core i5-2400 3.1GHz
    desktop using PSW v0.51 and Perl v5.18.2. Operating system is Debian sid
    (64bit).

    For perspective, empty subroutine ("sub {}") as well as "sub { [200,
    "OK"] }" can be called around 5.3 mil/sec.

    Wrapping this subroutine "sub { [200, "OK"] }" and this simple metadata
    "{v=>1.1}" using default options yields call performance for $sub->() of
    about 0.9 mil/sec. With "validate_args=>0" and "validate_result=>0",
    it's 1.5 mil/sec.

lib/Perinci/Sub/Wrapper.pm  view on Meta::CPAN

to repeat validating result. E.g. used if you use
L<Dist::Zilla::Plugin::Rinci::Validate>.

=head2 x.perinci.sub.wrapper.logs => array

Generated/added by this module to the function metadata for every wrapping done.
Used to avoid adding repeated code, e.g. to validate result or arguments.

=head1 PERFORMANCE NOTES

The following numbers are produced on an Intel Core i5-2400 3.1GHz desktop using
PSW v0.51 and Perl v5.18.2. Operating system is Debian sid (64bit).

For perspective, empty subroutine (C<< sub {} >>) as well as C<< sub { [200,
"OK"] } >> can be called around 5.3 mil/sec.

Wrapping this subroutine C<< sub { [200, "OK"] } >> and this simple metadata C<<
{v=>1.1} >> using default options yields call performance for C<< $sub->() >> of
about 0.9 mil/sec. With C<< validate_args=>0 >> and C<< validate_result=>0 >>,
it's 1.5 mil/sec.



( run in 0.275 second using v1.01-cache-2.11-cpan-299005ec8e3 )