#!perl

use 5.010;
use strict;
use warnings;
use FindBin '$Bin';
use lib "$Bin/../lib";

use App::BenchPermuteNamedModules qw(@participants @datasets);
use Benchmark::Dumb qw(cmpthese);
use Module::Load;

no strict 'refs';
for my $ds (@datasets) {
    say "$ds->{name}:";
    my $bench_arg = {};
    for my $p (@participants) {
        load $p->{module};
        $bench_arg->{$p->{module}} = sub { $p->{code}->(@{ $ds->{args} }) };
    }
    cmpthese(0, $bench_arg);
    say "";
}

# ABSTRACT: Benchmark various modules doing permutation of multiple-valued key-value pairs
# PODNAME: bench-permute-named-modules

__END__

=pod

=encoding UTF-8

=head1 NAME

bench-permute-named-modules - Benchmark various modules doing permutation of multiple-valued key-value pairs

=head1 VERSION

This document describes version 0.01 of bench-permute-named-modules (from Perl distribution App-BenchPermuteNamedModules), released on 2015-10-03.

=head1 DESCRIPTION

Sample result:

 small (2x3=6):
                                  Rate PERLANCAR::Permute::Named Permute::Named Permute::Named::Iter
 PERLANCAR::Permute::Named 25063+-40/s                        --         -10.8%               -73.9%
 Permute::Named            28102+-92/s              12.13+-0.41%             --               -70.8%
 Permute::Named::Iter      96090+-31/s              283.4+-0.62%    241.9+-1.1%                   --
 
 long (2x50=100):
                                    Rate Permute::Named PERLANCAR::Permute::Named Permute::Named::Iter
 Permute::Named            3685.1+-5.7/s             --                    -49.5%               -61.7%
 PERLANCAR::Permute::Named 7299.9+-9.6/s    98.09+-0.4%                        --               -24.1%
 Permute::Named::Iter          9624+-0/s   161.16+-0.4%              31.84+-0.17%                   --
 
 wide (2**10=1k):
                                      Rate Permute::Named PERLANCAR::Permute::Named Permute::Named::Iter
 Permute::Named            98.556+-0.044/s             --                    -65.2%               -69.7%
 PERLANCAR::Permute::Named  282.99+-0.47/s  187.13+-0.49%                        --               -12.9%
 Permute::Named::Iter       324.77+-0.42/s  229.53+-0.45%              14.76+-0.24%                   --
 
 large (10x10x10x2x2x3=12ki):
                                      Rate Permute::Named PERLANCAR::Permute::Named Permute::Named::Iter
 Permute::Named            12.532+-0.012/s             --                    -67.6%               -70.1%
 PERLANCAR::Permute::Named  38.63+-0.086/s  208.26+-0.74%                        --                -7.7%
 Permute::Named::Iter      41.867+-0.089/s  234.09+-0.78%               8.38+-0.33%                   --

=head1 HOMEPAGE

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

=head1 SOURCE

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

=head1 BUGS

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

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
