NAME

Bencher::Scenario::ShellQuoteAny - Benchmark cross-platform shell quoting

VERSION

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

SYNOPSIS

To run benchmark with default option:

% bencher -m ShellQuoteAny

To run module startup overhead benchmark:

% bencher --module-startup -m ShellQuoteAny

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.

ShellQuote::Any 0.03

PERLANCAR::ShellQuote::Any 0.001

BENCHMARK PARTICIPANTS

  • ShellQuote::Any::shell_quote (perl_code)

    Function call template:

    ShellQuote::Any::shell_quote(<cmd>)
  • PERLANCAR::ShellQuote::Any::shell_quote (perl_code)

    Function call template:

    PERLANCAR::ShellQuote::Any::shell_quote(@{<cmd>})

BENCHMARK DATASETS

  • empty0

  • empty1

  • cmd1

  • cmd5

SAMPLE BENCHMARK RESULTS

Run on: perl: v5.22.2, CPU: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (4 cores), OS: GNU/Linux Debian version 8.5, OS kernel: Linux version 3.16.0-4-amd64.

Benchmark with default options (bencher -m ShellQuoteAny):

#table1#
{dataset=>"cmd1"}
+-----------------------------------------+-----------+-----------+------------+---------+---------+
| participant                             | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+-----------------------------------------+-----------+-----------+------------+---------+---------+
| ShellQuote::Any::shell_quote            |    451260 |     2.216 |       1    | 1.2e-11 |      20 |
| PERLANCAR::ShellQuote::Any::shell_quote |    489000 |     2.05  |       1.08 | 8.3e-10 |      20 |
+-----------------------------------------+-----------+-----------+------------+---------+---------+

#table2#
{dataset=>"cmd5"}
+-----------------------------------------+-----------+-----------+------------+---------+---------+
| participant                             | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+-----------------------------------------+-----------+-----------+------------+---------+---------+
| ShellQuote::Any::shell_quote            |    265540 |    3.7659 |       1    | 1.1e-11 |      32 |
| PERLANCAR::ShellQuote::Any::shell_quote |    273000 |    3.67   |       1.03 | 1.6e-09 |      21 |
+-----------------------------------------+-----------+-----------+------------+---------+---------+

#table3#
{dataset=>"empty0"}
+-----------------------------------------+-----------+-----------+------------+---------+---------+
| participant                             | rate (/s) | time (ns) | vs_slowest |  errors | samples |
+-----------------------------------------+-----------+-----------+------------+---------+---------+
| ShellQuote::Any::shell_quote            |   1045000 |     957.3 |       1    | 3.4e-11 |      20 |
| PERLANCAR::ShellQuote::Any::shell_quote |   1250000 |     801   |       1.19 | 4.2e-10 |      20 |
+-----------------------------------------+-----------+-----------+------------+---------+---------+

#table4#
{dataset=>"empty1"}
+-----------------------------------------+-----------+-----------+------------+---------+---------+
| participant                             | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+-----------------------------------------+-----------+-----------+------------+---------+---------+
| ShellQuote::Any::shell_quote            |    650000 |      1.5  |       1    | 2.1e-09 |      20 |
| PERLANCAR::ShellQuote::Any::shell_quote |    726000 |      1.38 |       1.11 | 4.2e-10 |      20 |
+-----------------------------------------+-----------+-----------+------------+---------+---------+

Benchmark module startup overhead (bencher -m ShellQuoteAny --module-startup):

#table5#
+----------------------------+-----------+------------------------+------------+---------+---------+
| participant                | time (ms) | mod_overhead_time (ms) | vs_slowest |  errors | samples |
+----------------------------+-----------+------------------------+------------+---------+---------+
| ShellQuote::Any            |       4.6 |                    2   |        1   |   2e-05 |      21 |
| PERLANCAR::ShellQuote::Any |       2.8 |                    0.2 |        1.6 | 2.4e-05 |      20 |
| perl -e1 (baseline)        |       2.6 |                    0   |        1.8 | 1.7e-05 |      21 |
+----------------------------+-----------+------------------------+------------+---------+---------+

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-Scenario-ShellQuoteAny.

SOURCE

Source repository is at https://github.com/perlancar/perl-Bencher-Scenario-ShellQuoteAny.

BUGS

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

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.

SEE ALSO

Bencher::Scenario::HashBuilding

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.