#!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.02 of bench-startup-levenshtein-modules (from Perl distribution App-BenchLevenshteinModules), released on 2015-09-22.

=head1 DESCRIPTION

Sample result:

                                              Rate perl+Text::LevenshteinXS perl+Text::Levenshtein perl+Text::Levenshtein::XS perl+PERLANCAR::Text::Levenshtein   perl
 perl+Text::LevenshteinXS            56.19+-0.49/s                       --                  -5.3%                     -37.9%                            -70.6% -74.5%
 perl+Text::Levenshtein            59.323+-0.096/s              5.58+-0.94%                     --                     -34.5%                            -69.0% -73.0%
 perl+Text::Levenshtein::XS        90.535+-0.039/s               61.1+-1.4%           52.61+-0.26%                         --                            -52.6% -58.8%
 perl+PERLANCAR::Text::Levenshtein  191.19+-0.16/s                240.3+-3%          222.29+-0.59%               111.18+-0.2%                                -- -13.1%
 perl                               219.98+-0.61/s              291.5+-3.6%            270.8+-1.2%              142.97+-0.68%                      15.05+-0.33%     --
 
 Average times:
   perl                             :     4.5459ms
   perl+PERLANCAR::Text::Levenshtein:     5.2304ms
   perl+Text::Levenshtein::XS       :    11.0455ms
   perl+Text::Levenshtein           :    16.8569ms
   perl+Text::LevenshteinXS         :    17.7968ms

=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
