#!perl

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

use App::BenchLevenshteinModules qw(@modules);
use Benchmark::Command;

my $bench_arg = {};

$bench_arg->{perl} = [$^X, "-Ilib", "-e1"];

for my $mod (@modules) {
    $bench_arg->{"perl+$mod->[0]"} = [$^X, "-Ilib", "-M$mod->[0]", "-e1"];
}

Benchmark::Command::run(100, $bench_arg);

# ABSTRACT: Benchmark startup of Levenshtein modules
# PODNAME: bench-startup-levenshtein-modules

__END__

=pod

=encoding UTF-8

=head1 NAME

bench-startup-levenshtein-modules - Benchmark startup of Levenshtein modules

=head1 VERSION

This document describes version 0.01 of bench-startup-levenshtein-modules (from Perl distribution App-BenchLevenshteinModules), released on 2015-09-18.

=head1 DESCRIPTION

Sample result:

                                             Rate perl+Text::LevenshteinXS perl+Text::Levenshtein perl+Text::Levenshtein::XS perl+PERLANCAR::Text::Levenshtein   perl
 perl+Text::LevenshteinXS            96.51+-0.3/s                       --                 -23.1%                     -52.3%                            -57.3% -83.8%
 perl+Text::Levenshtein            125.56+-0.27/s              30.1+-0.49%                     --                     -38.0%                            -44.4% -78.9%
 perl+Text::Levenshtein::XS        202.38+-0.34/s            109.69+-0.74%           61.18+-0.44%                         --                            -10.4% -66.1%
 perl+PERLANCAR::Text::Levenshtein 225.84+-0.39/s            134.01+-0.83%           79.87+-0.49%                11.6+-0.27%                                -- -62.1%
 perl                                596.1+-1.3/s              517.7+-2.3%            374.8+-1.4%              194.56+-0.81%                     163.95+-0.73%     --
 
 Average times:
   perl                             :     1.6776ms
   perl+PERLANCAR::Text::Levenshtein:     4.4279ms
   perl+Text::Levenshtein::XS       :     4.9412ms
   perl+Text::Levenshtein           :     7.9643ms
   perl+Text::LevenshteinXS         :    10.3616ms

=head1 HOMEPAGE

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

=head1 SOURCE

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

=head1 BUGS

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

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
