Bencher-Scenarios-RefUtil

 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.008, 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::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.034",
            "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"
         }
      }
   },
   "release_status" : "stable",
   "resources" : {
      "bugtracker" : {
         "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Bencher-Scenarios-RefUtil"
      },
      "homepage" : "https://metacpan.org/release/Bencher-Scenarios-RefUtil",

META.yml  view on Meta::CPAN

---
abstract: 'Benchmark Ref::Util'
author:
  - 'perlancar <perlancar@cpan.org>'
build_requires:
  Bencher::Backend: '1.034'
  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.008, 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-Scenarios-RefUtil
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-Scenarios-RefUtil
  homepage: https://metacpan.org/release/Bencher-Scenarios-RefUtil
  repository: git://github.com/perlancar/perl-Bencher-Scenarios-RefUtil.git
version: '0.002'
x_Dist_Zilla:

Makefile.PL  view on Meta::CPAN

# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.008.
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-Scenarios-RefUtil",
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.010001",
  "NAME" => "Bencher::Scenarios::RefUtil",
  "PREREQ_PM" => {
    "Ref::Util" => 0,
    "Scalar::Util" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "Bencher::Backend" => "1.034",
    "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.034",
  "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};

lib/Bencher/Scenario/RefUtil.pm  view on Meta::CPAN

package Bencher::Scenario::RefUtil;

our $DATE = '2017-01-25'; # DATE
our $VERSION = '0.002'; # VERSION

use 5.010001;
use strict;
use warnings;

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::RefUtil - Benchmark Ref::Util

=head1 VERSION

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

=head1 SYNOPSIS

To run benchmark with default option:

 % bencher -m RefUtil

lib/Bencher/Scenario/RefUtil.pm  view on Meta::CPAN

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

L<Scalar::Util> 1.45

=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/RefUtil.pm  view on Meta::CPAN

 +-------------------+-----------+-----------+------------+---------+---------+


Benchmark module startup overhead (C<< bencher -m RefUtil --module-startup >>):

 #table2#
 +---------------------+------------------------------+--------------------+----------------+-----------+------------------------+------------+---------+---------+
 | participant         | proc_private_dirty_size (kB) | proc_rss_size (MB) | proc_size (MB) | time (ms) | mod_overhead_time (ms) | vs_slowest |  errors | samples |
 +---------------------+------------------------------+--------------------+----------------+-----------+------------------------+------------+---------+---------+
 | Scalar::Util        | 844                          | 4.17               | 16             |      9.14 |                   4.14 |       1    | 8.8e-06 |    1016 |
 | Ref::Util           | 1016                         | 4.36               | 18.1           |      8.7  |                   3.7  |       1.05 | 8.5e-06 |     836 |
 | perl -e1 (baseline) | 1016                         | 4.37               | 18.1           |      5    |                   0    |       1.83 | 4.8e-06 |     290 |
 +---------------------+------------------------------+--------------------+----------------+-----------+------------------------+------------+---------+---------+


To display as an interactive HTML table on a browser, you can add option C<--format html+datatables>.

=head1 BENCHMARK NOTES

I'm not seeing significant performance difference between C<ref() eq "ARRAY">
and C<is_arrayref()> on my perls. Am I doing something wrong?

lib/Bencher/ScenarioR/RefUtil.pm  view on Meta::CPAN

                                            },
                                          ],
      "func.elapsed_time"              => 0.210684061050415,
      "func.module_startup"            => undef,
      "func.module_versions"           => {
                                            "__PACKAGE__" => 1.034,
                                            "Bencher::Scenario::RefUtil" => undef,
                                            "Benchmark::Dumb" => "0.10",
                                            "Devel::Platform::Info" => 0.16,
                                            "perl" => "v5.24.0",
                                            "Ref::Util" => 0.101,
                                            "Scalar::Util" => 1.45,
                                            "Sys::Info" => 0.78,
                                          },
      "func.note"                      => "Run by Pod::Weaver::Plugin::Bencher::Scenario",
      "func.permute"                   => ["perl", ["perl"], "participant", [0 .. 3]],
      "func.platform_info"             => {
                                            archname => "x86_64",
                                            codename => "rosa",
                                            is32bit  => 0,
                                            is64bit  => 1,

lib/Bencher/ScenarioR/RefUtil.pm  view on Meta::CPAN

                                            "time",
                                            "vs_slowest",
                                            "errors",
                                            "samples",
                                          ],
    },
  ],
];

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.

lib/Bencher/Scenarios/RefUtil.pm  view on Meta::CPAN

package Bencher::Scenarios::RefUtil;

our $DATE = '2017-01-25'; # DATE
our $VERSION = '0.002'; # VERSION

1;
# ABSTRACT: Benchmark Ref::Util

__END__

=pod

=encoding UTF-8

=head1 NAME

Bencher::Scenarios::RefUtil - Benchmark Ref::Util

=head1 VERSION

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

=head1 DESCRIPTION

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

=over



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