NAME

Bencher::Scenario::LogGer::NullOutput - Benchmark Log::ger logging speed with the default/null output

VERSION

This document describes version 0.018 of Bencher::Scenario::LogGer::NullOutput (from Perl distribution Bencher-Scenarios-LogGer), released on 2021-04-09.

SYNOPSIS

To run benchmark with default option:

 % bencher -m LogGer::NullOutput

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::Any 1.708

Log::Contextual 0.008001

Log::Contextual::SimpleLogger 0.008001

Log::Dispatch 2.68

Log::Dispatch::Null 2.68

Log::Dispatchouli 2.019

Log::Fast v2.0.1

Log::Log4perl 1.49

Log::Log4perl::Tiny 1.4.0

Log::ger 0.038

Log::ger::Format::MultilevelLog 0.038

Log::ger::Plugin::OptAway 0.009

Mojo::Log

XLog 1.1.0

BENCHMARK PARTICIPANTS

  • Log::ger-100k_log_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::ger -e for(1..100_000) { log_trace(q[]) }
  • Log::ger-100k_log_is_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::ger -e for(1..100_000) { log_is_trace() }
  • Log::ger+LGP:OptAway-100k_log_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::ger::Plugin=OptAway -MLog::ger -e for(1..100_000) { log_trace(q[]) }
  • Log::ger+LGF:MutilevelLog-100k_log_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::ger::Format=MultilevelLog -MLog::ger -e for(1..100_000) { log("trace", q[]) }
  • Log::ger+LGP:MutilevelLog-100k_log_6 (command)

    Command line:

     #TEMPLATE: #perl -MLog::ger::Format=MultilevelLog -MLog::ger -e for(1..100_000) { log(6, q[]) }
  • Log::Fast-100k_DEBUG (command)

    Command line:

     #TEMPLATE: #perl -MLog::Fast -e $LOG = Log::Fast->global; $LOG->level("INFO"); for(1..100_000) { $LOG->DEBUG(q()) }
  • Log::Fast-100k_is_debug (command)

    Command line:

     #TEMPLATE: #perl -MLog::Fast -e $LOG = Log::Fast->global; for(1..100_000) { $LOG->level() eq "DEBUG" }
  • Log::Any-no_adapter-100k_log_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::Any -e my $log = Log::Any->get_logger; for(1..100_000) { $log->trace(q[]) }
  • Log::Any-no_adapter-100k_is_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::Any -e my $log = Log::Any->get_logger; for(1..100_000) { $log->is_trace }
  • Log::Any-null_adapter-100k_log_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::Any -MLog::Any::Adapter -e Log::Any::Adapter->set(q[Null]); my $log = Log::Any->get_logger; for(1..100_000) { $log->trace(q[]) }
  • Log::Any-null_adapter-100k_is_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::Any -MLog::Any::Adapter -e Log::Any::Adapter->set(q[Null]); my $log = Log::Any->get_logger; for(1..100_000) { $log->is_trace }
  • Log::Dispatch::Null-100k_debug (command)

    Command line:

     #TEMPLATE: #perl -MLog::Dispatch -e my $null = Log::Dispatch->new(outputs=>[["Null", min_level=>"debug"]]); for(1..100_000) { $null->debug("") }
  • Log::Log4perl-easy-100k_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::Log4perl=:easy -e Log::Log4perl->easy_init($ERROR); for(1..100_000) { TRACE "" }
  • Log::Log4perl::Tiny-100k_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::Log4perl::Tiny=:easy -e for(1..100_000) { TRACE "" }
  • Log::Contextual+Log4perl-100k_trace (command)

    Command line:

     #TEMPLATE: #perl -e use Log::Contextual ":log", "set_logger"; use Log::Log4perl ":easy"; Log::Log4perl->easy_init($DEBUG); my $logger = Log::Log4perl->get_logger; set_logger $logger; for(1..100_000) { log_trace {} }
  • Log::Contextual+SimpleLogger-100k_trace (command)

    Command line:

     #TEMPLATE: #perl -MLog::Contextual::SimpleLogger -e use Log::Contextual ":log", -logger=>Log::Contextual::SimpleLogger->new({levels=>["debug"]}); for(1..100_000) { log_trace {} }
  • Log::Dispatchouli-100k_debug (command)

    Command line:

     #TEMPLATE: #perl -MLog::Dispatchouli -e $logger = Log::Dispatchouli->new({ident=>"ident", facility=>"facility", to_stdout=>1, debug=>0}); for(1..100_000) { $logger->log_debug("") }
  • Mojo::Log-100k_debug (command)

    Command line:

     #TEMPLATE: #perl -MMojo::Log -e $log = Mojo::Log->new(level=>"warn"); for(1..100_000) { $log->debug("") }
  • XLog-100k_debug (command)

    Command line:

     #TEMPLATE: #perl -MXLog -e for(1..100_000) { XLog::debug("") }

SAMPLE BENCHMARK RESULTS

Run on: perl: v5.30.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.3.0-64-generic.

Benchmark with default options (bencher -m LogGer::NullOutput):

 #table1#
 +------------------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | participant                              | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
 +------------------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | Log::Dispatch::Null-100k_debug           |       2   |     600   |                 0.00% |              4599.10% |   0.018   |       7 |
 | Log::Contextual+Log4perl-100k_trace      |       2.2 |     460   |                30.73% |              3494.48% |   0.0025  |       7 |
 | Log::Contextual+SimpleLogger-100k_trace  |       2.2 |     450   |                34.01% |              3406.53% |   0.00059 |       6 |
 | Log::Dispatchouli-100k_debug             |       6.2 |     160   |               276.69% |              1147.47% |   0.00058 |       6 |
 | Mojo::Log-100k_debug                     |       6.9 |     150   |               318.32% |              1023.34% |   0.00046 |       6 |
 | Log::Log4perl::Tiny-100k_trace           |       9.8 |     100   |               495.29% |               689.38% |   0.00026 |       6 |
 | Log::Fast-100k_is_debug                  |      16   |      61   |               891.83% |               373.78% | 9.3e-05   |       7 |
 | Log::Any-null_adapter-100k_log_trace     |      17   |      60   |               905.87% |               367.17% | 6.7e-05   |       6 |
 | Log::Log4perl-easy-100k_trace            |      19   |      54   |              1033.66% |               314.51% |   0.00018 |       8 |
 | Log::Any-null_adapter-100k_is_trace      |      20   |      40   |              1338.80% |               226.60% |   0.00046 |       6 |
 | Log::Any-no_adapter-100k_is_trace        |      24.7 |      40.5 |              1399.74% |               213.33% | 2.2e-05   |       6 |
 | Log::Fast-100k_DEBUG                     |      26   |      38   |              1508.96% |               192.06% |   0.00016 |       6 |
 | XLog-100k_debug                          |      37   |      27   |              2119.96% |               111.67% |   0.00014 |       6 |
 | Log::Any-no_adapter-100k_log_trace       |      41   |      24   |              2381.63% |                89.36% | 4.9e-05   |       6 |
 | Log::ger+LGP:OptAway-100k_log_trace      |      46   |      22   |              2704.34% |                67.57% | 3.3e-05   |       6 |
 | Log::ger+LGF:MutilevelLog-100k_log_trace |      49   |      21   |              2858.75% |                58.82% | 5.4e-05   |       6 |
 | Log::ger+LGP:MutilevelLog-100k_log_6     |      50   |      20   |              2910.54% |                56.09% |   9e-05   |       7 |
 | Log::ger-100k_log_trace                  |      74   |      14   |              4383.10% |                 4.82% | 8.4e-05   |       6 |
 | Log::ger-100k_log_is_trace               |      77   |      13   |              4599.10% |                 0.00% | 2.6e-05   |       6 |
 +------------------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+

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

SOURCE

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

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/perlancar/perl-Bencher-Scenarios-LogGer/issues

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) 2021, 2020, 2018, 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.