#!perl

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

use 5.010001;
use strict;
use warnings;
use experimental 'smartmatch';

use App::BenchSerializers;
use Benchmark::Command;

my $contestants = \%App::BenchSerializers::contestants;

Benchmark::Command::run(
    undef,
    {
        'none'                => [$^X, "-e1"],

        map {
            $_ => [$^X, "-e", "use $_"],
        } grep {'json' ~~ @{$contestants->{$_}{tags}//[]}}
        sort keys %$contestants,
    },
);

# ABSTRACT: Benchmark startup time of Perl JSON modules
# PODNAME: bench-startup-json-modules

__END__

=pod

=encoding UTF-8

=head1 NAME

bench-startup-json-modules - Benchmark startup time of Perl JSON modules

=head1 VERSION

This document describes version 0.01 of bench-startup-json-modules (from Perl distribution App-BenchSerializers), released on 2015-06-29.

=head1 SYNOPSIS

 % bench-startup-json-modules

Sample output:

                                  Rate JSON::Decode::Marpa      JSON::PP  Pegex::JSON JSON::MaybeXS      JSON::XS JSON::Decode::Regexp   none
 JSON::Decode::Marpa   12.908+-0.021/s                  --        -84.2%       -86.8%        -90.3%        -93.8%               -96.1% -98.6%
 JSON::PP                 81.7+-0.29/s           533+-2.5%            --       -16.7%        -38.8%        -60.8%               -75.6% -91.1%
 Pegex::JSON             98.04+-0.15/s         659.5+-1.7%  19.99+-0.47%           --        -26.5%        -53.0%               -70.7% -89.4%
 JSON::MaybeXS        133.433+-0.096/s         933.8+-1.8%   63.31+-0.6%  36.1+-0.23%            --        -36.0%               -60.1% -85.5%
 JSON::XS               208.63+-0.17/s        1516.3+-2.9% 155.35+-0.94% 112.8+-0.37%  56.35+-0.17%            --               -37.6% -77.4%
 JSON::Decode::Regexp     334.4+-1.1/s          2491+-9.6%     309.3+-2%  241.1+-1.3% 150.64+-0.86%   60.3+-0.55%                   -- -63.7%
 none                     921.5+-1.3/s           7039+-15%  1027.8+-4.4%    839.9+-2%   590.6+-1.1% 341.68+-0.72%            175.5+-1%     --
 
 Average times:
   none                :     1.0852ms
   JSON::Decode::Regexp:     2.9904ms
   JSON::XS            :     4.7932ms
   JSON::MaybeXS       :     7.4944ms
   Pegex::JSON         :    10.1999ms
   JSON::PP            :    12.2399ms
   JSON::Decode::Marpa :    77.4713ms

=head1 SEE ALSO

=head1 HOMEPAGE

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

=head1 SOURCE

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

=head1 BUGS

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

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
