The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Bencher::Scenario::PerinciSubGetArgsArgv::get_args_from_argv - Benchmark get_args_from_argv()

VERSION

This document describes version 0.002 of Bencher::Scenario::PerinciSubGetArgsArgv::get_args_from_argv (from Perl distribution Bencher-Scenarios-PerinciSubGetArgsArgv), released on 2018-11-22.

SYNOPSIS

To run benchmark with default option:

 % bencher -m PerinciSubGetArgsArgv::get_args_from_argv

To run module startup overhead benchmark:

 % bencher --module-startup -m PerinciSubGetArgsArgv::get_args_from_argv

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

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.

BENCHMARKED MODULES

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

Perinci::Sub::GetArgs::Argv 0.840

BENCHMARK PARTICIPANTS

  • Perinci::Sub::GetArgs::Argv::get_args_from_argv (perl_code)

    Function call template:

     Perinci::Sub::GetArgs::Argv::get_args_from_argv(%{<args>})

BENCHMARK DATASETS

  • 0 known args + 0 args

  • meta norm + 0 known args + 0 args

  • 2 known args + 0 args

  • meta norm + 2 known args + 0 args

  • 2 known args + 2 args positional

  • 2 known args + 2 args named

  • meta norm + 2 known args + 2 args positional

  • meta norm + 2 known args + 2 args named

SAMPLE BENCHMARK RESULTS

Run on: perl: v5.26.0, CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz (4 cores), OS: GNU/Linux LinuxMint version 18.2, OS kernel: Linux version 4.8.0-53-generic.

Benchmark with default options (bencher -m PerinciSubGetArgsArgv::get_args_from_argv):

 #table1#
 +----------------------------------------------+-----------+-----------+------------+---------+---------+
 | dataset                                      | rate (/s) | time (μs) | vs_slowest |  errors | samples |
 +----------------------------------------------+-----------+-----------+------------+---------+---------+
 | 2 known args + 2 args named                  |      3920 |   255     |     1      | 2.1e-07 |      20 |
 | 2 known args + 2 args positional             |      4600 |   220     |     1.2    | 2.5e-07 |      23 |
 | meta norm + 2 known args + 2 args named      |      5000 |   200     |     1.3    | 2.7e-07 |      20 |
 | 2 known args + 0 args                        |      5300 |   190     |     1.3    | 4.3e-07 |      20 |
 | meta norm + 2 known args + 2 args positional |      6000 |   170     |     1.5    | 2.1e-07 |      20 |
 | meta norm + 2 known args + 0 args            |      7400 |   140     |     1.9    | 2.1e-07 |      20 |
 | 0 known args + 0 args                        |     20000 |    50     |     5.1    | 1.1e-07 |      20 |
 | meta norm + 0 known args + 0 args            |     28815 |    34.705 |     7.3581 | 4.5e-11 |      20 |
 +----------------------------------------------+-----------+-----------+------------+---------+---------+

Benchmark module startup overhead (bencher -m PerinciSubGetArgsArgv::get_args_from_argv --module-startup):

 #table2#
 +-----------------------------+-----------+------------------------+------------+---------+---------+
 | participant                 | time (ms) | mod_overhead_time (ms) | vs_slowest |  errors | samples |
 +-----------------------------+-----------+------------------------+------------+---------+---------+
 | Perinci::Sub::GetArgs::Argv |      20   |                   13.9 |        1   | 0.00037 |      20 |
 | perl -e1 (baseline)         |       6.1 |                    0   |        3.5 | 6e-05   |      20 |
 +-----------------------------+-----------+------------------------+------------+---------+---------+

To display as an interactive HTML table on a browser, you can add option --format html+datatables.

HOMEPAGE

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

SOURCE

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

BUGS

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

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) 2018 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.