The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bencher::Scenario::HumanDateParsingModules::Parsing - Benchmark human date parsing modules e.g. DF:Natural, DF:Alami, etc.

VERSION

This document describes version 0.007 of Bencher::Scenario::HumanDateParsingModules::Parsing (from Perl distribution Bencher-Scenarios-HumanDateParsingModules), released on 2017-06-09.

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.14

DateTime::Format::Alami::ID 0.14

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) i5-2400 CPU @ 3.10GHz (4 cores), OS: GNU/Linux Debian version 8.0, OS kernel: Linux version 3.16.0-4-amd64.

Benchmark with default options (bencher -m HumanDateParsingModules::Parsing):

 #table1#
 {dataset=>"18 feb"}
 +-----------------------------+---------+-----------+-----------+------------+---------+---------+
 | participant                 | p_tags  | rate (/s) | time (ms) | vs_slowest |  errors | samples |
 +-----------------------------+---------+-----------+-----------+------------+---------+---------+
 | DateTime::Format::Flexible  | lang:en |       340 |      2.9  |        1   | 2.4e-05 |      21 |
 | Date::Extract               | lang:en |       600 |      2    |        2   |   2e-05 |      20 |
 | DateTime::Format::Alami::EN | lang:en |       960 |      1    |        2.8 | 3.6e-06 |      20 |
 | DateTime::Format::Natural   | lang:en |      1000 |      0.98 |        3   | 2.9e-06 |      20 |
 | DateTime::Format::Alami::ID | lang:id |      1500 |      0.68 |        4.3 | 1.5e-06 |      20 |
 +-----------------------------+---------+-----------+-----------+------------+---------+---------+
 #table2#
 {dataset=>"18 feb 2011"}
 +-----------------------------+---------+-----------+-----------+------------+---------+---------+
 | participant                 | p_tags  | rate (/s) | time (ms) | vs_slowest |  errors | samples |
 +-----------------------------+---------+-----------+-----------+------------+---------+---------+
 | Date::Extract               | lang:en |       180 |       5.6 |        1   | 1.8e-05 |      21 |
 | DateTime::Format::Natural   | lang:en |       210 |       4.7 |        1.2 | 1.7e-05 |      20 |
 | DateTime::Format::Flexible  | lang:en |       370 |       2.7 |        2.1 | 1.6e-05 |      21 |
 | DateTime::Format::Alami::EN | lang:en |       370 |       2.7 |        2.1 | 7.2e-06 |      21 |
 | DateTime::Format::Alami::ID | lang:id |       630 |       1.6 |        3.6 | 8.5e-06 |      21 |
 +-----------------------------+---------+-----------+-----------+------------+---------+---------+
 #table3#
 {dataset=>"18 feb 2011 06:30:45"}
 +-----------------------------+---------+-----------+-----------+------------+---------+---------+
 | participant                 | p_tags  | rate (/s) | time (ms) | vs_slowest |  errors | samples |
 +-----------------------------+---------+-----------+-----------+------------+---------+---------+
 | Date::Extract               | lang:en |       180 |       5.5 |        1   | 1.7e-05 |      20 |
 | DateTime::Format::Flexible  | lang:en |       350 |       2.8 |        1.9 | 1.8e-05 |      24 |
 | DateTime::Format::Natural   | lang:en |       440 |       2.3 |        2.4 | 1.1e-05 |      20 |
 | DateTime::Format::Alami::EN | lang:en |      1400 |       0.7 |        7.7 | 1.1e-06 |      21 |
 | DateTime::Format::Alami::ID | lang:id |      1400 |       0.7 |        7.7 |   2e-06 |      20 |
 +-----------------------------+---------+-----------+-----------+------------+---------+---------+
 #table4#
 {dataset=>"hari ini"}
 +-----------------------------+----------+---------+---------+------+-----------+-----------+------------+---------+---------+
 | participant                 | dataset  | ds_tags | p_tags  | perl | rate (/s) | time (μs) | vs_slowest |  errors | samples |
 +-----------------------------+----------+---------+---------+------+-----------+-----------+------------+---------+---------+
 | DateTime::Format::Alami::ID | hari ini |         | lang:id | perl |      3600 |       280 |          1 | 6.9e-07 |      20 |
 +-----------------------------+----------+---------+---------+------+-----------+-----------+------------+---------+---------+
 #table5#
 {dataset=>"today"}
 +-----------------------------+-----------+-----------+------------+---------+---------+
 | participant                 | rate (/s) | time (ms) | vs_slowest |  errors | samples |
 +-----------------------------+-----------+-----------+------------+---------+---------+
 | DateTime::Format::Flexible  |       350 |     2.8   |       1    | 1.7e-05 |      21 |
 | Date::Extract               |       990 |     1     |       2.8  | 5.6e-06 |      20 |
 | DateTime::Format::Natural   |      2700 |     0.37  |       7.7  | 3.7e-07 |      20 |
 | DateTime::Format::Alami::EN |      3500 |     0.286 |       9.88 | 2.7e-07 |      20 |
 +-----------------------------+-----------+-----------+------------+---------+---------+

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.82                         | 4.1                | 20             |     120   |                  114.2 |        1   |   0.00031 |      20 |
 | Date::Extract               | 16                           | 20                 | 60             |     110   |                  104.2 |        1.1 |   0.00016 |      20 |
 | DateTime::Format::Natural   | 16                           | 20                 | 60             |     110   |                  104.2 |        1.1 |   0.00014 |      20 |
 | DateTime::Format::Alami::ID | 16                           | 20                 | 60             |      25   |                   19.2 |        4.8 | 6.5e-05   |      20 |
 | DateTime::Format::Alami::EN | 2.8                          | 6.4                | 24             |      25   |                   19.2 |        4.9 | 6.3e-05   |      20 |
 | perl -e1 (baseline)         | 2.8                          | 6.3                | 24             |       5.8 |                    0   |       21   | 3.7e-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, 2016 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.