NAME
Bencher::Scenario::HumanDateParsingModules::Parsing - Benchmark human date parsing modules e.g. DF:Natural, DF:Alami, etc.
VERSION
This document describes version 0.006 of Bencher::Scenario::HumanDateParsingModules::Parsing (from Perl distribution Bencher-Scenarios-HumanDateParsingModules), released on 2017-01-25.
SYNOPSIS
To run benchmark with default option:
% bencher -m HumanDateParsingModules::Parsing
To run module startup overhead benchmark:
% bencher --module-startup -m HumanDateParsingModules::Parsing
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.
Date::Extract 0.05.01
DateTime::Format::Alami::EN 0.13
DateTime::Format::Alami::ID 0.13
DateTime::Format::Flexible 0.26
DateTime::Format::Natural 1.04
BENCHMARK PARTICIPANTS
DateTime::Format::Alami::EN (perl_code) [lang:en]
Code template:
state $parser = DateTime::Format::Alami::EN->new; $parser->parse_datetime(<text>)
DateTime::Format::Alami::ID (perl_code) [lang:id]
Code template:
state $parser = DateTime::Format::Alami::ID->new; $parser->parse_datetime(<text>)
Date::Extract (perl_code) [lang:en]
Code template:
state $parser = Date::Extract->new; $parser->extract(<text>)
DateTime::Format::Natural (perl_code) [lang:en]
Code template:
state $parser = DateTime::Format::Natural->new; $parser->parse_datetime(<text>)
DateTime::Format::Flexible (perl_code) [lang:en]
Code template:
DateTime::Format::Flexible->parse_datetime(<text>)
BENCHMARK DATASETS
18 feb
18 feb 2011
18 feb 2011 06:30:45
today
hari ini
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 HumanDateParsingModules::Parsing
):
#table1#
{dataset=>"18 feb"}
+-----------------------------+-----------+-----------+------------+---------+---------+
| participant | rate (/s) | time (ms) | vs_slowest | errors | samples |
+-----------------------------+-----------+-----------+------------+---------+---------+
| DateTime::Format::Flexible | 380 | 2.6 | 1 | 1.5e-05 | 20 |
| Date::Extract | 960 | 1 | 2.5 | 4.5e-06 | 20 |
| DateTime::Format::Alami::EN | 991 | 1.01 | 2.6 | 4.3e-07 | 20 |
| DateTime::Format::Natural | 2000 | 0.7 | 4 | 1.7e-05 | 33 |
| DateTime::Format::Alami::ID | 1660 | 0.602 | 4.37 | 4.3e-07 | 20 |
+-----------------------------+-----------+-----------+------------+---------+---------+
#table2#
{dataset=>"18 feb 2011"}
+-----------------------------+-----------+-----------+------------+---------+---------+
| participant | rate (/s) | time (ms) | vs_slowest | errors | samples |
+-----------------------------+-----------+-----------+------------+---------+---------+
| DateTime::Format::Natural | 200 | 5 | 1 | 8.9e-05 | 20 |
| Date::Extract | 310 | 3.2 | 1.5 | 5.6e-06 | 20 |
| DateTime::Format::Flexible | 400 | 2.5 | 1.9 | 1.6e-05 | 20 |
| DateTime::Format::Alami::EN | 410 | 2.4 | 2 | 1.3e-05 | 20 |
| DateTime::Format::Alami::ID | 736 | 1.36 | 3.49 | 1.1e-06 | 20 |
+-----------------------------+-----------+-----------+------------+---------+---------+
#table3#
{dataset=>"18 feb 2011 06:30:45"}
+-----------------------------+-----------+-----------+------------+---------+---------+
| participant | rate (/s) | time (ms) | vs_slowest | errors | samples |
+-----------------------------+-----------+-----------+------------+---------+---------+
| Date::Extract | 310 | 3.2 | 1 | 4.3e-06 | 22 |
| DateTime::Format::Flexible | 390 | 2.5 | 1.3 | 1.6e-05 | 20 |
| DateTime::Format::Natural | 625 | 1.6 | 2.01 | 6.4e-07 | 20 |
| DateTime::Format::Alami::EN | 1500 | 0.65 | 4.9 | 2.6e-06 | 26 |
| DateTime::Format::Alami::ID | 1600 | 0.62 | 5.2 | 6.9e-07 | 20 |
+-----------------------------+-----------+-----------+------------+---------+---------+
#table4#
{dataset=>"hari ini"}
+-----------------------------+----------+------+-----------+-----------+------------+---------+---------+
| participant | dataset | perl | rate (/s) | time (μs) | vs_slowest | errors | samples |
+-----------------------------+----------+------+-----------+-----------+------------+---------+---------+
| DateTime::Format::Alami::ID | hari ini | perl | 4000 | 250 | 1 | 4.3e-07 | 20 |
+-----------------------------+----------+------+-----------+-----------+------------+---------+---------+
#table5#
{dataset=>"today"}
+-----------------------------+-----------+-----------+------------+---------+---------+
| participant | rate (/s) | time (ms) | vs_slowest | errors | samples |
+-----------------------------+-----------+-----------+------------+---------+---------+
| DateTime::Format::Flexible | 400 | 2.5 | 1 | 1e-05 | 20 |
| Date::Extract | 1200 | 0.8 | 3.1 | 8.3e-07 | 21 |
| DateTime::Format::Natural | 2690 | 0.371 | 6.75 | 2.7e-07 | 20 |
| DateTime::Format::Alami::EN | 4000 | 0.25 | 9.9 | 9e-07 | 31 |
+-----------------------------+-----------+-----------+------------+---------+---------+
Benchmark module startup overhead (bencher -m HumanDateParsingModules::Parsing --module-startup
):
#table6#
+-----------------------------+------------------------------+--------------------+----------------+-----------+------------------------+------------+-----------+---------+
| participant | proc_private_dirty_size (MB) | proc_rss_size (MB) | proc_size (MB) | time (ms) | mod_overhead_time (ms) | vs_slowest | errors | samples |
+-----------------------------+------------------------------+--------------------+----------------+-----------+------------------------+------------+-----------+---------+
| DateTime::Format::Flexible | 0.83 | 4.1 | 16 | 100 | 94.6 | 1 | 0.00025 | 20 |
| Date::Extract | 16 | 20 | 56 | 93 | 87.6 | 1.1 | 0.00021 | 20 |
| DateTime::Format::Natural | 16 | 20 | 56 | 91 | 85.6 | 1.1 | 0.00016 | 20 |
| DateTime::Format::Alami::ID | 16 | 20 | 56 | 22 | 16.6 | 4.7 | 0.00013 | 20 |
| DateTime::Format::Alami::EN | 2.8 | 6.4 | 20 | 22 | 16.6 | 4.8 | 0.00011 | 20 |
| perl -e1 (baseline) | 2.7 | 6.4 | 20 | 5.4 | 0 | 19 | 2.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-HumanDateParsingModules.
SOURCE
Source repository is at https://github.com/perlancar/perl-Bencher-Scenarios-DateTimeFormatAlami.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Bencher-Scenarios-HumanDateParsingModules
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) 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.