NAME

Bencher::Scenario::URI::Info::info - Benchmark info()

VERSION

This document describes version 0.002 of Bencher::Scenario::URI::Info::info (from Perl distribution Bencher-Scenarios-URI-Info), released on 2021-10-08.

SYNOPSIS

To run benchmark with default option:

% bencher -m URI::Info::info

To run module startup overhead benchmark:

% bencher --module-startup -m URI::Info::info

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.

URI::Info 0.001

URI::ParseSearchString 3.51

BENCHMARK PARTICIPANTS

  • URI::Info (all 3 plugins) (perl_code)

    Code template:

    state $ui = URI::Info->new(); $ui->info(<url>)
  • URI::Info (google plugin only) (perl_code)

    Code template:

    state $ui = URI::Info->new(include_plugins=>["SearchQuery::google"]); $ui->info(<url>)
  • URI::ParseSearchString->se_term (perl_code)

    Code template:

    state $us = URI::ParseSearchString->new; $us->se_term(<url>)
  • URI::ParseSearchString->se_term+findEngine (perl_code)

    Code template:

    state $us = URI::ParseSearchString->new; ($us->se_term(<url>), $us->findEngine(<url>))

BENCHMARK DATASETS

  • google

  • google maps (not included by default)

SAMPLE BENCHMARK RESULTS

Run on: perl: v5.34.0, CPU: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (2 cores), OS: GNU/Linux Ubuntu version 20.04, OS kernel: Linux version 5.3.0-64-generic.

Benchmark with default options (bencher -m URI::Info::info):

#table1#
+--------------------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
| participant                                | rate (/s) | time (μs) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors | samples |
+--------------------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
| URI::Info (all 3 plugins)                  |     24307 |    41.141 |                 0.00% |               146.96% |   6e-11 |      20 |
| URI::Info (google plugin only)             |     24500 |    40.8   |                 0.72% |               145.20% | 3.7e-08 |      24 |
| URI::ParseSearchString->se_term+findEngine |     36200 |    27.6   |                48.87% |                65.89% | 1.3e-08 |      20 |
| URI::ParseSearchString->se_term            |     60000 |    17     |               146.96% |                 0.00% | 2.7e-08 |      20 |
+--------------------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+

Formatted as Benchmark.pm result:

                                                Rate  URI::Info (all 3 plugins)  URI::Info (google plugin only)  URI::ParseSearchString->se_term+findEngine  URI::ParseSearchString->se_term 
 URI::Info (all 3 plugins)                   24307/s                         --                              0%                                        -32%                             -58% 
 URI::Info (google plugin only)              24500/s                         0%                              --                                        -32%                             -58% 
 URI::ParseSearchString->se_term+findEngine  36200/s                        49%                             47%                                          --                             -38% 
 URI::ParseSearchString->se_term             60000/s                       142%                            140%                                         62%                               -- 

Legends:
  URI::Info (all 3 plugins): participant=URI::Info (all 3 plugins)
  URI::Info (google plugin only): participant=URI::Info (google plugin only)
  URI::ParseSearchString->se_term: participant=URI::ParseSearchString->se_term
  URI::ParseSearchString->se_term+findEngine: participant=URI::ParseSearchString->se_term+findEngine

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-URI-Info.

SOURCE

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

SEE ALSO

AUTHOR

perlancar <perlancar@cpan.org>

CONTRIBUTING

To contribute, you can send patches by email/via RT, or send pull requests on GitHub.

Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:

% prove -l

If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional steps required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE

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

BUGS

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

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.