Bencher-ScenarioBundle-Ref-Util

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

{
   "abstract" : "Benchmark Ref::Util",
   "author" : [
      "perlancar <perlancar@cpan.org>"
   ],
   "dynamic_config" : 0,
   "generated_by" : "Dist::Zilla version 6.032, CPAN::Meta::Converter version 2.150010",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",

META.json  view on Meta::CPAN

      "develop" : {
         "requires" : {
            "Pod::Coverage::TrustPod" : "0",
            "Test::Perl::Critic" : "0",
            "Test::Pod" : "1.41",
            "Test::Pod::Coverage" : "1.08"
         }
      },
      "runtime" : {
         "requires" : {
            "Ref::Util" : "0",
            "Scalar::Util" : "0",
            "perl" : "5.010001",
            "strict" : "0",
            "warnings" : "0"
         }
      },
      "test" : {
         "requires" : {
            "Bencher::Backend" : "1.063",
            "File::Spec" : "0",
            "IO::Handle" : "0",
            "IPC::Open3" : "0",
            "Test::More" : "0"
         }
      },
      "x_benchmarks" : {
         "requires" : {
            "Ref::Util" : "0",
            "Scalar::Util" : "0"
         },
         "x_benchmarks" : {
            "Ref::Util" : "0",
            "Scalar::Util" : "0"
         }
      }
   },
   "provides" : {
      "Bencher::Scenario::Ref::Util" : {
         "file" : "lib/Bencher/Scenario/Ref/Util.pm",
         "version" : "0.003"
      },
      "Bencher::ScenarioBundle::Ref::Util" : {
         "file" : "lib/Bencher/ScenarioBundle/Ref/Util.pm",
         "version" : "0.003"
      }
   },
   "release_status" : "stable",
   "resources" : {
      "bugtracker" : {
         "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Bencher-ScenarioBundle-Ref-Util"
      },
      "homepage" : "https://metacpan.org/release/Bencher-ScenarioBundle-Ref-Util",

META.yml  view on Meta::CPAN

---
abstract: 'Benchmark Ref::Util'
author:
  - 'perlancar <perlancar@cpan.org>'
build_requires:
  Bencher::Backend: '1.063'
  File::Spec: '0'
  IO::Handle: '0'
  IPC::Open3: '0'
  Test::More: '0'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.032, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Bencher-ScenarioBundle-Ref-Util
provides:
  Bencher::Scenario::Ref::Util:
    file: lib/Bencher/Scenario/Ref/Util.pm
    version: '0.003'
  Bencher::ScenarioBundle::Ref::Util:
    file: lib/Bencher/ScenarioBundle/Ref/Util.pm
    version: '0.003'
requires:
  Ref::Util: '0'
  Scalar::Util: '0'
  perl: '5.010001'
  strict: '0'
  warnings: '0'
resources:
  bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Bencher-ScenarioBundle-Ref-Util
  homepage: https://metacpan.org/release/Bencher-ScenarioBundle-Ref-Util
  repository: git://github.com/perlancar/perl-Bencher-ScenarioBundle-Ref-Util.git
version: '0.003'
x_Dist_Zilla:

Makefile.PL  view on Meta::CPAN

# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.032.
use strict;
use warnings;

use 5.010001;

use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
  "ABSTRACT" => "Benchmark Ref::Util",
  "AUTHOR" => "perlancar <perlancar\@cpan.org>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "Bencher-ScenarioBundle-Ref-Util",
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.010001",
  "NAME" => "Bencher::ScenarioBundle::Ref::Util",
  "PREREQ_PM" => {
    "Ref::Util" => 0,
    "Scalar::Util" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "Bencher::Backend" => "1.063",
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,
    "Test::More" => 0

Makefile.PL  view on Meta::CPAN

    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Bencher::Backend" => "1.063",
  "File::Spec" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "Ref::Util" => 0,
  "Scalar::Util" => 0,
  "Test::More" => 0,
  "strict" => 0,
  "warnings" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};

README  view on Meta::CPAN

NAME
    Bencher::ScenarioBundle::Ref::Util - Benchmark Ref::Util

VERSION
    This document describes version 0.003 of
    Bencher::ScenarioBundle::Ref::Util (from Perl distribution
    Bencher-ScenarioBundle-Ref-Util), released on 2024-12-04.

DESCRIPTION
    This distribution contains the following Bencher scenario modules:

    *   Bencher::Scenario::Ref::Util

HOMEPAGE
    Please visit the project's homepage at
    <https://metacpan.org/release/Bencher-ScenarioBundle-Ref-Util>.

SOURCE
    Source repository is at
    <https://github.com/perlancar/perl-Bencher-ScenarioBundle-Ref-Util>.

AUTHOR

lib/Bencher/Scenario/Ref/Util.pm  view on Meta::CPAN

package Bencher::Scenario::Ref::Util;

use 5.010001;
use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2024-12-04'; # DATE
our $DIST = 'Bencher-ScenarioBundle-Ref-Util'; # DIST
our $VERSION = '0.003'; # VERSION

our $scenario = {
    summary => 'Benchmark Ref::Util',
    precision => 0.001,
    participants => [
        {
            name=>'is_arrayref',
            module => 'Ref::Util',
            code_template => 'no warnings "void"; state $ref = []; Ref::Util::is_arrayref($ref) for 1..1000',
        },
        {
            name=>'is_plain_arrayref',
            module => 'Ref::Util',
            code_template => 'no warnings "void"; state $ref = []; Ref::Util::is_plain_arrayref($ref) for 1..1000',
        },
        {
            name=>'ref(ARRAY)',
            code_template => 'no warnings "void"; state $ref = []; ref($ref) eq "ARRAY" for 1..1000',
        },
        {
            name=>'reftype(ARRAY)',
            module => 'Scalar::Util',
            code_template => 'no warnings "void"; state $ref = []; Scalar::Util::reftype($ref) eq "ARRAY" for 1..1000',
        },
    ],
};

1;
# ABSTRACT: Benchmark Ref::Util

__END__

=pod

=encoding UTF-8

=head1 NAME

Bencher::Scenario::Ref::Util - Benchmark Ref::Util

=head1 VERSION

This document describes version 0.003 of Bencher::Scenario::Ref::Util (from Perl distribution Bencher-ScenarioBundle-Ref-Util), released on 2024-12-04.

=head1 SYNOPSIS

To run benchmark with default option:

 % bencher -m Ref::Util

To run module startup overhead benchmark:

 % bencher --module-startup -m Ref::Util

For more options (dump scenario, list/include/exclude/add participants, list/include/exclude/add datasets, etc), see L<bencher> or run C<bencher --help>.

=head1 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 L<Bencher> and L<bencher> (CLI) for more de...

=head1 BENCHMARKED MODULES

Version numbers shown below are the versions used when running the sample benchmark.

L<Ref::Util> 0.204

L<Scalar::Util> 1.63

=head1 BENCHMARK PARTICIPANTS

=over

=item * is_arrayref (perl_code)

Code template:

 no warnings "void"; state $ref = []; Ref::Util::is_arrayref($ref) for 1..1000



=item * is_plain_arrayref (perl_code)

Code template:

 no warnings "void"; state $ref = []; Ref::Util::is_plain_arrayref($ref) for 1..1000



=item * ref(ARRAY) (perl_code)

Code template:

 no warnings "void"; state $ref = []; ref($ref) eq "ARRAY" for 1..1000


lib/Bencher/Scenario/Ref/Util.pm  view on Meta::CPAN

=back

=head1 BENCHMARK SAMPLE RESULTS

=head2 Sample benchmark #1

Run on: perl: I<< v5.40.0 >>, CPU: I<< 12th Gen Intel(R) Core(TM) i7-1250U (10 cores) >>, OS: I<< GNU/Linux Debian version 12 >>, OS kernel: I<< Linux version 6.1.0-26-amd64 >>.

Benchmark command (default options):

 % bencher -m Ref::Util

Result formatted as table:

 #table1#
 +-------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | participant       | rate (/s) | time (μs) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors | samples |
 +-------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | reftype(ARRAY)    |     20100 |     49.8  |                 0.00% |               210.49% | 4.8e-08 |     136 |
 | ref(ARRAY)        |     30700 |     32.6  |                53.02% |               102.91% | 3.2e-08 |     135 |
 | is_plain_arrayref |     62000 |     16.1  |               209.05% |                 0.47% | 1.5e-08 |      22 |

lib/Bencher/Scenario/Ref/Util.pm  view on Meta::CPAN

 Legends:
   is_arrayref: participant=is_arrayref
   is_plain_arrayref: participant=is_plain_arrayref
   ref(ARRAY): participant=ref(ARRAY)
   reftype(ARRAY): participant=reftype(ARRAY)

=head2 Sample benchmark #2

Benchmark command (benchmarking module startup overhead):

 % bencher -m Ref::Util --module-startup

Result formatted as table:

 #table2#
 +---------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+
 | participant         | time (ms) | mod_overhead_time | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors | samples |
 +---------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+
 | Ref::Util           |       7.6 |               4   |                 0.00% |               111.74% | 1.1e-05 |    9461 |
 | Scalar::Util        |       7.2 |               3.6 |                 5.56% |               100.58% | 7.9e-06 |    9402 |
 | perl -e1 (baseline) |       3.6 |               0   |               111.74% |                 0.00% | 3.5e-06 |    3802 |
 +---------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+


The above result formatted in L<Benchmark.pm|Benchmark> style:

                          Rate   R:U   S:U  perl -e1 (baseline) 
  R:U                  131.6/s    --   -5%                 -52% 
  S:U                  138.9/s    5%    --                 -50% 
  perl -e1 (baseline)  277.8/s  111%  100%                   -- 
 
 Legends:
   R:U: mod_overhead_time=4 participant=Ref::Util
   S:U: mod_overhead_time=3.6 participant=Scalar::Util
   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 C<--format html+datatables>.

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/Bencher-ScenarioBundle-Ref-Util>.

=head1 SOURCE

lib/Bencher/ScenarioBundle/Ref/Util.pm  view on Meta::CPAN

package Bencher::ScenarioBundle::Ref::Util;

use strict;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2024-12-04'; # DATE
our $DIST = 'Bencher-ScenarioBundle-Ref-Util'; # DIST
our $VERSION = '0.003'; # VERSION

1;
# ABSTRACT: Benchmark Ref::Util

__END__

=pod

=encoding UTF-8

=head1 NAME

Bencher::ScenarioBundle::Ref::Util - Benchmark Ref::Util

=head1 VERSION

This document describes version 0.003 of Bencher::ScenarioBundle::Ref::Util (from Perl distribution Bencher-ScenarioBundle-Ref-Util), released on 2024-12-04.

=head1 DESCRIPTION

This distribution contains the following L<Bencher> scenario modules:

=over

=item * L<Bencher::Scenario::Ref::Util>

=back

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/Bencher-ScenarioBundle-Ref-Util>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-Bencher-ScenarioBundle-Ref-Util>.

lib/Bencher/ScenarioR/Ref/Util.pm  view on Meta::CPAN

## no critic
package Bencher::ScenarioR::Ref::Util;

our $VERSION = 0.003; # VERSION

our $results = [[200,"OK",[{_name=>"participant=reftype(ARRAY)",_succinct_name=>"reftype(ARRAY)",errors=>4.8e-08,participant=>"reftype(ARRAY)",pct_faster_vs_slowest=>0,pct_slower_vs_fastest=>2.10280373831776,rate=>20100,samples=>136,time=>49.8},{_nam...

1;
# ABSTRACT: Benchmark Ref::Util

=head1 DESCRIPTION

This module is automatically generated by Pod::Weaver::Plugin::Bencher::Scenario during distribution build.

A Bencher::ScenarioR::* module contains the raw result of sample benchmark and might be useful for some stuffs later.



( run in 1.079 second using v1.01-cache-2.11-cpan-a5abf4f5562 )