NAME
Bencher::Scenario::DamerauLevenshteinModules - Benchmark various modules calculating the Damerau-Levenshtein edit distance
VERSION
This document describes version 0.12 of Bencher::Scenario::DamerauLevenshteinModules (from Perl distribution Bencher-Scenarios-LevenshteinModules), released on 2017-01-13.
SYNOPSIS
To run benchmark with default option:
% bencher -m DamerauLevenshteinModules
To run module startup overhead benchmark:
% bencher --module-startup -m DamerauLevenshteinModules
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.
Text::Fuzzy 0.25
Text::Levenshtein::Damerau::PP 0.25
Text::Levenshtein::Damerau::XS 3.1
BENCHMARK PARTICIPANTS
Text::Levenshtein::Damerau::PP::pp_edistance (perl_code)
Function call template:
Text::Levenshtein::Damerau::PP::pp_edistance(<word1>, <word2>)
Text::Levenshtein::Damerau::XS::xs_edistance (perl_code)
Function call template:
Text::Levenshtein::Damerau::XS::xs_edistance(<word1>, <word2>)
Text::Fuzzy (perl_code)
Code template:
Text::Fuzzy->new(<word1>, trans=>1)->distance(<word2>)
BENCHMARK DATASETS
a
foo
program
reve [unicode]
euro [unicode]
SAMPLE BENCHMARK RESULTS
Run on: perl: v5.24.0, 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 default options (bencher -m DamerauLevenshteinModules
):
#table1#
+----------------------------------------------+---------+-----------+-----------+------------+---------+---------+
| participant | dataset | rate (/s) | time (μs) | vs_slowest | errors | samples |
+----------------------------------------------+---------+-----------+-----------+------------+---------+---------+
| Text::Levenshtein::Damerau::PP::pp_edistance | program | 17000 | 57 | 1 | 8e-08 | 20 |
| Text::Levenshtein::Damerau::PP::pp_edistance | reve | 38000 | 26.3 | 2.17 | 1.2e-08 | 26 |
| Text::Levenshtein::Damerau::PP::pp_edistance | euro | 39002 | 25.639 | 2.2323 | 4.6e-11 | 20 |
| Text::Levenshtein::Damerau::PP::pp_edistance | foo | 79000 | 13 | 4.5 | 2.1e-08 | 33 |
| Text::Levenshtein::Damerau::PP::pp_edistance | a | 241100 | 4.148 | 13.8 | 1e-10 | 22 |
| Text::Fuzzy | euro | 420000 | 2.4 | 24 | 2.5e-09 | 20 |
| Text::Levenshtein::Damerau::XS::xs_edistance | program | 477000 | 2.1 | 27.3 | 8.3e-10 | 20 |
| Text::Levenshtein::Damerau::XS::xs_edistance | euro | 500000 | 2 | 30 | 2.4e-08 | 20 |
| Text::Fuzzy | program | 620000 | 1.6 | 36 | 2.8e-09 | 29 |
| Text::Levenshtein::Damerau::XS::xs_edistance | reve | 626000 | 1.6 | 35.8 | 6.8e-10 | 30 |
| Text::Fuzzy | reve | 680000 | 1.5 | 39 | 5.4e-09 | 20 |
| Text::Levenshtein::Damerau::XS::xs_edistance | foo | 695700 | 1.437 | 39.82 | 4.6e-11 | 20 |
| Text::Fuzzy | foo | 791880 | 1.2628 | 45.324 | 9.4e-12 | 37 |
| Text::Levenshtein::Damerau::XS::xs_edistance | a | 991090 | 1.009 | 56.726 | 9.6e-12 | 20 |
| Text::Fuzzy | a | 1000000 | 1 | 57 | 1.7e-09 | 20 |
+----------------------------------------------+---------+-----------+-----------+------------+---------+---------+
Benchmark module startup overhead (bencher -m DamerauLevenshteinModules --module-startup
):
#table2#
+--------------------------------+------------------------------+--------------------+----------------+-----------+------------------------+------------+---------+---------+
| participant | proc_private_dirty_size (MB) | proc_rss_size (MB) | proc_size (MB) | time (ms) | mod_overhead_time (ms) | vs_slowest | errors | samples |
+--------------------------------+------------------------------+--------------------+----------------+-----------+------------------------+------------+---------+---------+
| Text::Fuzzy | 0.82 | 4.1 | 16 | 9.6 | 5.3 | 1 | 2.3e-05 | 20 |
| Text::Levenshtein::Damerau::PP | 0.98 | 4.4 | 18 | 8.1 | 3.8 | 1.2 | 1.1e-05 | 20 |
| Text::Levenshtein::Damerau::XS | 1.3 | 4.8 | 18 | 6.3 | 2 | 1.5 | 2.9e-05 | 21 |
| perl -e1 (baseline) | 1.1 | 4.4 | 18 | 4.3 | 0 | 2.2 | 1.3e-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-LevenshteinModules.
SOURCE
Source repository is at https://github.com/perlancar/perl-Bencher-Scenarios-LevenshteinModules.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Bencher-Scenarios-LevenshteinModules
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::LevenshteinModules
AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 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.