NAME

Bencher::Scenario::JSONDecodeRegexp - Benchmark JSON decoding

VERSION

This document describes version 0.001 of Bencher::Scenario::JSONDecodeRegexp (from Perl distribution Bencher-Scenarios-JSONDecodeRegexp), released on 2016-09-03.

SYNOPSIS

To run benchmark with default option:

% bencher -m JSONDecodeRegexp

To run module startup overhead benchmark:

% bencher --module-startup -m JSONDecodeRegexp

For more options (dump scenario, list/include/exclude/add participants, list/include/exclude/add datasets, etc), see bencher or run bencher --help.

BENCHMARKED MODULES

Version numbers shown below are the versions used when running the sample benchmark.

JSON::Decode::Regexp 0.08

JSON::PP 2.27300

BENCHMARK PARTICIPANTS

  • JSON::Decode::Regexp::from_json (perl_code)

    Function call template:

    JSON::Decode::Regexp::from_json(<data>)
  • JSON::PP::decode_json (perl_code)

    Function call template:

    JSON::PP::decode_json(<data>)

BENCHMARK DATASETS

  • array0

  • array1

  • array10

  • array100

  • hash0

  • hash1

  • hash10

  • hash100

SAMPLE BENCHMARK RESULTS

Run on: perl: v5.22.1, CPU: Intel(R) Core(TM) M-5Y71 CPU @ 1.20GHz (2 cores), OS: GNU/Linux LinuxMint version 17.3, OS kernel: Linux version 3.19.0-32-generic.

Benchmark with bencher -m JSONDecodeRegexp --include-path archive/JSON-Decode-Regexp-0.03/lib --include-path archive/JSON-Decode-Regexp-0.04/lib --include-path archive/JSON-Decode-Regexp-0.06/lib --include-path archive/JSON-Decode-Regexp-0.07/lib --multimodver JSON::Decode::Regexp:

#table1#
{dataset=>"array0"}
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| participant                     | modver | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| JSON::Decode::Regexp::from_json | 0.04   |     10000 |     97    |        1   | 2.4e-07 |      20 |
| JSON::Decode::Regexp::from_json | 0.06   |     12000 |     84    |        1.2 | 2.3e-07 |      21 |
| JSON::Decode::Regexp::from_json | 0.03   |     17000 |     58    |        1.7 | 1.9e-07 |      24 |
| JSON::PP::decode_json           |        |    190000 |      5.3  |       18   | 6.7e-09 |      20 |
| JSON::Decode::Regexp::from_json | 0.08   |    281000 |      3.55 |       27.3 | 1.4e-09 |      30 |
| JSON::Decode::Regexp::from_json | 0.07   |    284000 |      3.52 |       27.6 | 1.5e-09 |      25 |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+

#table2#
{dataset=>"array1"}
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| participant                     | modver | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| JSON::Decode::Regexp::from_json | 0.04   |     10000 |     100   |        1   | 1.1e-06 |      20 |
| JSON::Decode::Regexp::from_json | 0.06   |     11000 |      87   |        1.2 | 1.1e-07 |      20 |
| JSON::Decode::Regexp::from_json | 0.03   |     15000 |      68   |        1.5 |   8e-08 |      20 |
| JSON::PP::decode_json           |        |    110000 |       9.5 |       11   | 2.7e-08 |      20 |
| JSON::Decode::Regexp::from_json | 0.08   |    180000 |       5.7 |       18   | 6.5e-09 |      21 |
| JSON::Decode::Regexp::from_json | 0.07   |    182000 |       5.5 |       18.3 | 1.7e-09 |      20 |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+

#table3#
{dataset=>"array10"}
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| participant                     | modver | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| JSON::Decode::Regexp::from_json | 0.04   |      7400 |     130   |       1    | 1.1e-06 |      21 |
| JSON::Decode::Regexp::from_json | 0.03   |      7600 |     130   |       1    | 2.1e-07 |      20 |
| JSON::Decode::Regexp::from_json | 0.06   |      8900 |     110   |       1.2  | 2.5e-07 |      23 |
| JSON::PP::decode_json           |        |     25000 |      40   |       3.4  | 5.3e-08 |      20 |
| JSON::Decode::Regexp::from_json | 0.07   |     39000 |      25.6 |       5.26 | 1.2e-08 |      24 |
| JSON::Decode::Regexp::from_json | 0.08   |     39100 |      25.6 |       5.27 | 1.3e-08 |      21 |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+

#table4#
{dataset=>"array100"}
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| participant                     | modver | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| JSON::Decode::Regexp::from_json | 0.03   |      1300 |       800 |       1    | 1.4e-06 |      20 |
| JSON::Decode::Regexp::from_json | 0.04   |      2400 |       420 |       1.9  | 1.3e-06 |      22 |
| JSON::PP::decode_json           |        |      2700 |       380 |       2.1  | 5.5e-07 |      23 |
| JSON::Decode::Regexp::from_json | 0.06   |      3380 |       296 |       2.71 | 2.5e-07 |      22 |
| JSON::Decode::Regexp::from_json | 0.08   |      4550 |       220 |       3.64 | 1.4e-07 |      27 |
| JSON::Decode::Regexp::from_json | 0.07   |      5100 |       200 |       4.1  |   2e-07 |      22 |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+

#table5#
{dataset=>"hash0"}
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| participant                     | modver | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| JSON::Decode::Regexp::from_json | 0.04   |     10000 |     97    |        1   | 3.4e-07 |      21 |
| JSON::Decode::Regexp::from_json | 0.06   |     12000 |     84    |        1.1 | 1.7e-07 |      23 |
| JSON::Decode::Regexp::from_json | 0.03   |     18000 |     56    |        1.7 | 1.9e-07 |      24 |
| JSON::PP::decode_json           |        |    188000 |      5.31 |       18.2 | 1.6e-09 |      21 |
| JSON::Decode::Regexp::from_json | 0.08   |    320000 |      3.1  |       31   | 6.2e-09 |      23 |
| JSON::Decode::Regexp::from_json | 0.07   |    380000 |      2.6  |       37   | 3.3e-09 |      20 |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+

#table6#
{dataset=>"hash1"}
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| participant                     | modver | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| JSON::Decode::Regexp::from_json | 0.04   |      8000 |     100   |       1    | 1.4e-06 |      23 |
| JSON::Decode::Regexp::from_json | 0.06   |      9200 |     110   |       1.1  | 2.5e-07 |      22 |
| JSON::Decode::Regexp::from_json | 0.03   |     11000 |      92   |       1.3  | 1.9e-07 |      20 |
| JSON::Decode::Regexp::from_json | 0.08   |     66000 |      15   |       8    | 2.7e-08 |      20 |
| JSON::PP::decode_json           |        |     72300 |      13.8 |       8.67 | 6.7e-09 |      20 |
| JSON::Decode::Regexp::from_json | 0.07   |     75000 |      13   |       9    | 2.7e-08 |      20 |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+

#table7#
{dataset=>"hash10"}
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| participant                     | modver | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| JSON::Decode::Regexp::from_json | 0.03   |      4600 |       217 |        1   | 2.1e-07 |      20 |
| JSON::Decode::Regexp::from_json | 0.06   |      5100 |       200 |        1.1 |   2e-07 |      22 |
| JSON::Decode::Regexp::from_json | 0.04   |      6000 |       200 |        1   |   2e-06 |      25 |
| JSON::Decode::Regexp::from_json | 0.08   |      9600 |       100 |        2.1 | 1.9e-07 |      26 |
| JSON::Decode::Regexp::from_json | 0.07   |     11000 |        90 |        2.4 | 1.1e-07 |      20 |
| JSON::PP::decode_json           |        |     13000 |        80 |        2.7 | 1.9e-07 |      33 |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+

#table8#
{dataset=>"hash100"}
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| participant                     | modver | rate (/s) | time (ms) | vs_slowest |  errors | samples |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+
| JSON::Decode::Regexp::from_json | 0.03   |       444 |     2.25  |       1    | 1.8e-06 |      20 |
| JSON::Decode::Regexp::from_json | 0.06   |      1020 |     0.982 |       2.29 | 8.5e-07 |      20 |
| JSON::Decode::Regexp::from_json | 0.04   |      1040 |     0.965 |       2.33 | 8.5e-07 |      20 |
| JSON::Decode::Regexp::from_json | 0.08   |      1120 |     0.892 |       2.53 | 6.9e-07 |      20 |
| JSON::Decode::Regexp::from_json | 0.07   |      1150 |     0.868 |       2.6  | 4.3e-07 |      20 |
| JSON::PP::decode_json           |        |      1320 |     0.756 |       2.98 | 2.7e-07 |      20 |
+---------------------------------+--------+-----------+-----------+------------+---------+---------+

DESCRIPTION

Packaging a benchmark script as a Bencher scenario makes it convenient to include/exclude/add participants/datasets (either via CLI or Perl code), send the result to a central repository, among others . See Bencher and bencher (CLI) for more details.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Bencher-Scenarios-JSONDecodeRegexp.

SOURCE

Source repository is at https://github.com/perlancar/perl-Bencher-Scenarios-JSONDecodeRegexp.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Bencher-Scenarios-JSONDecodeRegexp

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.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 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.