NAME

Bencher::Scenario::CloneModules - Benchmark various data cloning modules

VERSION

This document describes version 0.04 of Bencher::Scenario::CloneModules (from Perl distribution Bencher-Scenarios-CloneModules), released on 2017-01-25.

SYNOPSIS

To run benchmark with default option:

 % bencher -m CloneModules

To run module startup overhead benchmark:

 % bencher --module-startup -m CloneModules

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.

Clone 0.38

Clone::PP 1.06

Data::Clone 0.004

Sereal::Dclone 0.002

Storable 2.56

BENCHMARK PARTICIPANTS

  • Clone::clone (perl_code)

    Function call template:

     Clone::clone(<data>)
  • Clone::PP::clone (perl_code)

    Function call template:

     Clone::PP::clone(<data>)
  • Data::Clone::clone (perl_code)

    Function call template:

     Data::Clone::clone(<data>)
  • Sereal::Dclone::dclone (perl_code)

    Function call template:

     Sereal::Dclone::dclone(<data>)
  • Storable::dclone (perl_code)

    Function call template:

     Storable::dclone(<data>)

BENCHMARK DATASETS

  • array0

  • array1

  • array10

  • array100

  • array1k

  • array10k

  • hash1k

  • hash10k

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 cloning a 10k-element array (bencher -m CloneModules --include-datasets array10k):

 #table1#
 +------------------------+-----------+-----------+------------+---------+---------+
 | participant            | rate (/s) | time (ms) | vs_slowest |  errors | samples |
 +------------------------+-----------+-----------+------------+---------+---------+
 | Clone::clone           |       240 |     4.2   |       1    | 3.5e-05 |      20 |
 | Clone::PP::clone       |       796 |     1.26  |       3.32 | 1.1e-06 |      20 |
 | Storable::dclone       |       900 |     1     |       4    | 1.7e-05 |      20 |
 | Sereal::Dclone::dclone |      1970 |     0.508 |       8.21 | 2.7e-07 |      20 |
 | Data::Clone::clone     |      2000 |     0.5   |       8.33 | 4.3e-07 |      20 |
 +------------------------+-----------+-----------+------------+---------+---------+

Benchmark cloning a 10k-pair hash (bencher -m CloneModules --include-datasets hash10k):

 #table2#
 +------------------------+-----------+-----------+------------+---------+---------+
 | participant            | rate (/s) | time (ms) | vs_slowest |  errors | samples |
 +------------------------+-----------+-----------+------------+---------+---------+
 | Clone::clone           |       100 |      10   |        1   | 4.9e-05 |      21 |
 | Clone::PP::clone       |       120 |       8.3 |        1.2 |   6e-05 |      20 |
 | Storable::dclone       |       180 |       5.6 |        1.8 | 9.6e-06 |      20 |
 | Data::Clone::clone     |       180 |       5.4 |        1.8 | 3.7e-05 |      20 |
 | Sereal::Dclone::dclone |       220 |       4.6 |        2.2 | 2.2e-05 |      20 |
 +------------------------+-----------+-----------+------------+---------+---------+

Benchmark module startup overhead (bencher -m CloneModules --module-startup):

 #table3#
 +---------------------+------------------------------+--------------------+----------------+-----------+------------------------+------------+-----------+---------+
 | participant         | proc_private_dirty_size (MB) | proc_rss_size (MB) | proc_size (MB) | time (ms) | mod_overhead_time (ms) | vs_slowest |  errors   | samples |
 +---------------------+------------------------------+--------------------+----------------+-----------+------------------------+------------+-----------+---------+
 | Storable            | 0.82                         | 4                  | 16             |      16   |                    9.9 |        1   | 6.3e-05   |      20 |
 | Sereal::Dclone      | 1.8                          | 5.3                | 21             |      15   |                    8.9 |        1   | 8.3e-05   |      21 |
 | Clone               | 1                            | 4.4                | 16             |      14   |                    7.9 |        1.1 |   0.00012 |      20 |
 | Data::Clone         | 1.5                          | 5.2                | 21             |      11   |                    4.9 |        1.5 | 4.5e-05   |      20 |
 | Clone::PP           | 1.1                          | 4.5                | 18             |      10   |                    3.9 |        1.5 | 4.2e-05   |      20 |
 | perl -e1 (baseline) | 1.3                          | 4.6                | 18             |       6.1 |                    0   |        2.5 | 1.5e-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-CloneModules.

SOURCE

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

BUGS

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

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