NAME

Bencher::Scenario::DataCleansing::Object_DateTime - Benchmark data cleansing (DateTime objects into scalar)

VERSION

This document describes version 0.004 of Bencher::Scenario::DataCleansing::Object_DateTime (from Perl distribution Bencher-Scenarios-DataCleansing), released on 2017-08-25.

SYNOPSIS

To run benchmark with default option:

% bencher -m DataCleansing::Object_DateTime

To run module startup overhead benchmark:

% bencher --module-startup -m DataCleansing::Object_DateTime

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.

Acme::Damn 0.08

Data::Clean 0.49

Data::Rmap 0.64

Data::Tersify 0.001

Scalar::Util 1.45

BENCHMARK PARTICIPANTS

  • Data::Clean-inplace (perl_code) [inplace]

    Code template:

    state $cl = Data::Clean->new(DateTime => ["stringify"]); $cl->clean_in_place(<data>)
  • Data::Clean-clone (perl_code)

    Code template:

    state $cl = Data::Clean->new(DateTime => ["stringify"]); $cl->clone_and_clean(<data>)
  • Data::Rmap (perl_code) [inplace]

    Code template:

    my $data = <data>; Data::Rmap::rmap_ref(sub { if (ref $_ eq "DateTime") { "$_" } else { $_ } }, $data); $data
  • Data::Tersify (perl_code)

    Code template:

    Data::Tersify::tersify(<data>)

BENCHMARK DATASETS

  • ary1-dt1

    A 1-element array containing 1 DateTime object

  • ary10-dt10

    A 10-element array containing 10 DateTime objects

  • ary100-dt100

    A 100-element array containing 100 DateTime objects

  • ary1000-dt1000

    A 1000-element array containing 1000 DateTime objects

  • ary1000-dt1

    A 1000-element array containing 1 DateTime objects

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 DataCleansing::Object_DateTime):

#table1#
+---------------------+----------------+---------+-----------+-----------+------------+---------+---------+
| participant         | dataset        | p_tags  | rate (/s) | time (ms) | vs_slowest |  errors | samples |
+---------------------+----------------+---------+-----------+-----------+------------+---------+---------+
| Data::Rmap          | ary1000-dt1000 | inplace |      12.2 |    82     |       1    | 7.7e-05 |      20 |
| Data::Tersify       | ary1000-dt1000 |         |      60   |    17     |       4.9  | 6.6e-05 |      20 |
| Data::Clean-clone   | ary1000-dt1000 |         |      67   |    15     |       5.5  | 3.8e-05 |      20 |
| Data::Clean-inplace | ary1000-dt1000 | inplace |      92.3 |    10.8   |       7.57 | 7.4e-06 |      20 |
| Data::Rmap          | ary100-dt100   | inplace |     120   |     8.7   |       9.4  | 2.5e-05 |      30 |
| Data::Rmap          | ary1000-dt1    | inplace |     270   |     3.7   |      22    | 9.9e-06 |      20 |
| Data::Tersify       | ary100-dt100   |         |     628   |     1.59  |      51.5  | 1.4e-06 |      20 |
| Data::Rmap          | ary10-dt10     | inplace |     636   |     1.57  |      52.2  | 9.1e-07 |      20 |
| Data::Clean-clone   | ary100-dt100   |         |     802   |     1.25  |      65.8  | 6.9e-07 |      20 |
| Data::Clean-inplace | ary100-dt100   | inplace |    1050   |     0.956 |      85.8  | 4.3e-07 |      20 |
| Data::Rmap          | ary1-dt1       | inplace |    1160   |     0.863 |      95    | 4.3e-07 |      20 |
| Data::Tersify       | ary1000-dt1    |         |    1250   |     0.803 |     102    | 4.3e-07 |      20 |
| Data::Clean-clone   | ary1000-dt1    |         |    3160   |     0.316 |     259    | 2.1e-07 |      20 |
| Data::Clean-inplace | ary1000-dt1    | inplace |    3780   |     0.265 |     310    | 2.1e-07 |      21 |
| Data::Tersify       | ary10-dt10     |         |    4500   |     0.22  |     370    | 7.3e-07 |      31 |
| Data::Clean-clone   | ary10-dt10     |         |    5900   |     0.17  |     480    |   2e-07 |      22 |
| Data::Clean-inplace | ary10-dt10     | inplace |    6800   |     0.15  |     560    |   2e-07 |      23 |
| Data::Tersify       | ary1-dt1       |         |   14000   |     0.07  |    1200    |   2e-07 |      22 |
| Data::Clean-clone   | ary1-dt1       |         |   17000   |     0.059 |    1400    | 1.1e-07 |      20 |
| Data::Clean-inplace | ary1-dt1       | inplace |   18000   |     0.056 |    1500    | 5.5e-07 |      21 |
+---------------------+----------------+---------+-----------+-----------+------------+---------+---------+

Benchmark module startup overhead (bencher -m DataCleansing::Object_DateTime --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 |
+---------------------+------------------------------+--------------------+----------------+-----------+------------------------+------------+---------+---------+
| Data::Tersify       | 12                           | 16                 | 46             |      33   |                   25.6 |        1   | 3.7e-05 |      20 |
| Data::Rmap          | 1.4                          | 4.9                | 19             |      16   |                    8.6 |        2   | 6.3e-05 |      20 |
| Data::Clean         | 1.1                          | 4.6                | 16             |      13   |                    5.6 |        2.5 | 7.5e-05 |      20 |
| perl -e1 (baseline) | 1.1                          | 4.6                | 16             |       7.4 |                    0   |        4.4 | 2.2e-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-DataCleansing.

SOURCE

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

BUGS

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

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

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.