NAME

Bencher::Scenario::Complete::Util::complete_array_elem - Benchmark complete_array_elem()

VERSION

This document describes version 0.051 of Bencher::Scenario::Complete::Util::complete_array_elem (from Perl distribution Bencher-Scenarios-Complete-Util), released on 2023-01-18.

SYNOPSIS

To run benchmark with default option:

% bencher -m Complete::Util::complete_array_elem

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.

Complete::Util 0.615

Text::Levenshtein::Flexible 0.09

Text::Levenshtein::XS 0.503

BENCHMARK PARTICIPANTS

  • prefix-noci-1000 (perl_code)

  • prefix-1000 (perl_code)

  • wordmode-1000 (perl_code)

  • charmode-1000 (perl_code)

  • fuzzy-xs-1000 (perl_code)

  • fuzzy-flex-1000 (perl_code)

  • fuzzy-pp-1000 (perl_code)

  • fuzzy-pp-100 (perl_code)

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.4.0-91-generic.

Benchmark with default options (bencher -m Complete::Util::complete_array_elem):

#table1#
+------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
| participant      | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
+------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
| fuzzy-pp-1000    |      4.68 |   214     |                 0.00% |             48711.74% |   0.00013 |      20 |
| fuzzy-pp-100     |     35    |    28     |               651.85% |              6392.20% | 5.9e-05   |      21 |
| fuzzy-xs-1000    |    100    |    10     |              2035.81% |              2185.40% |   0.00011 |      20 |
| fuzzy-flex-1000  |    540    |     1.8   |             11506.23% |               320.56% | 3.9e-06   |      24 |
| wordmode-1000    |    680    |     1.5   |             14444.06% |               235.61% | 1.6e-06   |      20 |
| charmode-1000    |   1240    |     0.808 |             26340.48% |                84.61% | 2.7e-07   |      20 |
| prefix-1000      |   1950    |     0.513 |             41602.02% |                17.05% | 2.1e-07   |      20 |
| prefix-noci-1000 |   2280    |     0.438 |             48711.74% |                 0.00% | 2.1e-07   |      20 |
+------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+

Formatted as Benchmark.pm result:

                     Rate  fuzzy-pp-1000  fuzzy-pp-100  fuzzy-xs-1000  fuzzy-flex-1000  wordmode-1000  charmode-1000  prefix-1000  prefix-noci-1000 
 fuzzy-pp-1000     4.68/s             --          -86%           -95%             -99%           -99%           -99%         -99%              -99% 
 fuzzy-pp-100        35/s           664%            --           -64%             -93%           -94%           -97%         -98%              -98% 
 fuzzy-xs-1000      100/s          2039%          179%             --             -82%           -85%           -91%         -94%              -95% 
 fuzzy-flex-1000    540/s         11788%         1455%           455%               --           -16%           -55%         -71%              -75% 
 wordmode-1000      680/s         14166%         1766%           566%              19%             --           -46%         -65%              -70% 
 charmode-1000     1240/s         26385%         3365%          1137%             122%            85%             --         -36%              -45% 
 prefix-1000       1950/s         41615%         5358%          1849%             250%           192%            57%           --              -14% 
 prefix-noci-1000  2280/s         48758%         6292%          2183%             310%           242%            84%          17%                -- 

Legends:
  charmode-1000: participant=charmode-1000
  fuzzy-flex-1000: participant=fuzzy-flex-1000
  fuzzy-pp-100: participant=fuzzy-pp-100
  fuzzy-pp-1000: participant=fuzzy-pp-1000
  fuzzy-xs-1000: participant=fuzzy-xs-1000
  prefix-1000: participant=prefix-1000
  prefix-noci-1000: participant=prefix-noci-1000
  wordmode-1000: participant=wordmode-1000

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-Complete-Util.

SOURCE

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

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, Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE

This software is copyright (c) 2023, 2017, 2016 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-Complete-Util

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.