NAME

Bencher::Scenario::Log::Dispatch::Startup - Benchmark module startup overhead of some Log::Dispatch modules

VERSION

This document describes version 0.030 of Bencher::Scenario::Log::Dispatch::Startup (from Perl distribution Bencher-Scenarios-Log-Dispatch), released on 2023-10-29.

SYNOPSIS

To run benchmark with default option:

% bencher -m Log::Dispatch::Startup

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.

Log::Dispatch::Base 2.71

Log::Dispatch::Dir 0.160

Log::Dispatch::File 2.71

Log::Dispatch::FileWriteRotate 0.062

Log::Dispatch::Null 2.71

Log::Dispatch::Perl 0.05

Log::Dispatch::Screen 2.71

Log::Dispatch::Screen::Color 0.04

BENCHMARK PARTICIPANTS

BENCHMARK SAMPLE RESULTS

Sample benchmark #1

Run on: perl: v5.38.0, CPU: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (2 cores), OS: GNU/Linux Ubuntu version 20.04, OS kernel: Linux version 5.4.0-164-generic.

Benchmark command (default options):

% bencher -m Log::Dispatch::Startup

Result formatted as table:

#table1#
+--------------------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+
| participant                    | time (ms) | mod_overhead_time | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors | samples |
+--------------------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+
| Log::Dispatch::FileWriteRotate |     98.3  |             92.28 |                 0.00% |              1531.50% | 4.1e-05 |      23 |
| Log::Dispatch::Screen::Color   |     93.2  |             87.18 |                 5.51% |              1446.34% | 2.9e-05 |      20 |
| Log::Dispatch::Dir             |     89.9  |             83.88 |                 9.32% |              1392.34% |   5e-05 |      20 |
| Log::Dispatch::Screen          |     88.6  |             82.58 |                10.94% |              1370.60% | 7.4e-05 |      21 |
| Log::Dispatch::File            |     85.7  |             79.68 |                14.76% |              1321.64% | 4.1e-05 |      20 |
| Log::Dispatch::Perl            |     79.9  |             73.88 |                23.09% |              1225.46% | 3.7e-05 |      23 |
| Log::Dispatch::Null            |     79.3  |             73.28 |                23.96% |              1216.12% | 1.6e-05 |      20 |
| Log::Dispatch::Base            |     14.1  |              8.08 |               596.89% |               134.11% | 7.8e-06 |      20 |
| perl -e1 (baseline)            |      6.02 |              0    |              1531.50% |                 0.00% | 3.1e-06 |      20 |
+--------------------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+

The above result formatted in Benchmark.pm style:

                                    Rate  Log::Dispatch::FileWriteRotate  Log::Dispatch::Screen::Color  Log::Dispatch::Dir  Log::Dispatch::Screen  Log::Dispatch::File  Log::Dispatch::Perl  Log::Dispatch::Null  Log::Dispatch::Base  perl -e1 (baseline) 
 Log::Dispatch::FileWriteRotate   10.2/s                              --                           -5%                 -8%                    -9%                 -12%                 -18%                 -19%                 -85%                 -93% 
 Log::Dispatch::Screen::Color     10.7/s                              5%                            --                 -3%                    -4%                  -8%                 -14%                 -14%                 -84%                 -93% 
 Log::Dispatch::Dir               11.1/s                              9%                            3%                  --                    -1%                  -4%                 -11%                 -11%                 -84%                 -93% 
 Log::Dispatch::Screen            11.3/s                             10%                            5%                  1%                     --                  -3%                  -9%                 -10%                 -84%                 -93% 
 Log::Dispatch::File              11.7/s                             14%                            8%                  4%                     3%                   --                  -6%                  -7%                 -83%                 -92% 
 Log::Dispatch::Perl              12.5/s                             23%                           16%                 12%                    10%                   7%                   --                   0%                 -82%                 -92% 
 Log::Dispatch::Null              12.6/s                             23%                           17%                 13%                    11%                   8%                   0%                   --                 -82%                 -92% 
 Log::Dispatch::Base              70.9/s                            597%                          560%                537%                   528%                 507%                 466%                 462%                   --                 -57% 
 perl -e1 (baseline)             166.1/s                           1532%                         1448%               1393%                  1371%                1323%                1227%                1217%                 134%                   -- 

Legends:
  Log::Dispatch::Base: mod_overhead_time=8.08 participant=Log::Dispatch::Base
  Log::Dispatch::Dir: mod_overhead_time=83.88 participant=Log::Dispatch::Dir
  Log::Dispatch::File: mod_overhead_time=79.68 participant=Log::Dispatch::File
  Log::Dispatch::FileWriteRotate: mod_overhead_time=92.28 participant=Log::Dispatch::FileWriteRotate
  Log::Dispatch::Null: mod_overhead_time=73.28 participant=Log::Dispatch::Null
  Log::Dispatch::Perl: mod_overhead_time=73.88 participant=Log::Dispatch::Perl
  Log::Dispatch::Screen: mod_overhead_time=82.58 participant=Log::Dispatch::Screen
  Log::Dispatch::Screen::Color: mod_overhead_time=87.18 participant=Log::Dispatch::Screen::Color
  perl -e1 (baseline): mod_overhead_time=0 participant=perl -e1 (baseline)

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

SOURCE

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

AUTHOR

perlancar <perlancar@cpan.org>

CONTRIBUTING

To contribute, you can send patches by email/via RT, or send pull requests on GitHub.

Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:

% prove -l

If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE

This software is copyright (c) 2023, 2017, 2016 by perlancar <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.

BUGS

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

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.