#!perl

our $DATE = '2015-09-06'; # DATE
our $VERSION = '0.01'; # VERSION

use 5.010001;
use strict;
use warnings;

use Benchmark::Dumb qw(cmpthese);
use Params::Sah qw(gen_validator);
use Params::Validate qw(:all);

cmpthese(
    0,
    {
        'PS int'     => sub { state $v = gen_validator('int'); $v->(@_) },
        'PS int x3'  => sub { state $v = gen_validator('int','int','int'); $v->(@_) },
        'PS int x5'  => sub { state $v = gen_validator('int','int','int','int','int'); $v->(@_) },
        'PS str'     => sub { state $v = gen_validator('str'); $v->(@_) },
        'PS str x3'  => sub { state $v = gen_validator('str','str','str'); $v->(@_) },
        'PV str'     => sub { validate_pos(@_, {type=>'SCALAR', default=>undef}) },
        'PV str x3'  => sub { validate_pos(@_, {type=>'SCALAR', default=>undef}, {type=>'SCALAR', default=>undef}, {type=>'SCALAR', default=>undef}) },
    },
);

# ABSTRACT: Benchmark Params::Sah
# PODNAME: bench-params-sah

__END__

=pod

=encoding UTF-8

=head1 NAME

bench-params-sah - Benchmark Params::Sah

=head1 VERSION

This document describes version 0.01 of bench-params-sah (from Perl distribution App-BenchParamsSah), released on 2015-09-06.

=head1 SYNOPSIS

 % bench-params-sah

Sample output:

                         Rate    PV str x3        PV str    PS int x5    PS str x3 PS int x3 PS str PS int
 PV str x3        562606+-0/s           --        -36.1%       -75.8%       -78.7%    -79.2% -83.3% -83.8%
 PV str         880217+-8.9/s        56.5%            --       -62.1%       -66.7%    -67.4% -73.8% -74.6%
 PS int x5 2.3231e+06+-4500/s 312.91+-0.8% 163.92+-0.51%           --       -12.2%    -14.0% -30.9% -32.9%
 PS str x3 2.6456e+06+-5800/s    370.2+-1% 200.56+-0.66% 13.88+-0.33%           --     -2.1% -21.3% -23.6%
 PS int x3   2.70179e+06+-0/s       380.2%        206.9%  16.3+-0.23%  2.12+-0.23%        -- -19.6% -22.0%
 PS str    3.3619e+06+-1300/s       497.6%        281.9% 44.72+-0.29% 27.08+-0.28%     24.4%     --  -2.9%
 PS int    3.46307e+06+-540/s       515.5%        293.4% 49.07+-0.29%  30.9+-0.29%     28.2%   3.0%     --

=head1 DESCRIPTION

=head1 SEE ALSO

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-BenchParamsSah>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-BenchParamsSah>.

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=App-BenchParamsSah>

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
