App-BencherUtils

 view release on metacpan or  search on metacpan

script/gen-bencher-scenario-from-cpanmodules  view on Meta::CPAN

#!perl

# Note: This script is a CLI for Riap function /Acme/CPANModulesUtil/Bencher/gen_bencher_scenario
# and generated automatically using Perinci::CmdLine::Gen version 0.501

use 5.010001;
use strict;
use warnings;
use Log::ger;

use Perinci::CmdLine::Any;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-08-24'; # DATE
our $DIST = 'App-BencherUtils'; # DIST
our $VERSION = '0.245'; # VERSION

my $cmdline = Perinci::CmdLine::Any->new(
    url => "/Acme/CPANModulesUtil/Bencher/gen_bencher_scenario",
    program_name => "gen-bencher-scenario-from-cpanmodules",
    log => 1,
    read_config => 0,
    read_env => 0,
);

$cmdline->run;

# ABSTRACT: Generate/extract Bencher scenario from information in an Acme::CPANModules::* list
# PODNAME: gen-bencher-scenario-from-cpanmodules

__END__

=pod

=encoding UTF-8

=head1 NAME

gen-bencher-scenario-from-cpanmodules - Generate/extract Bencher scenario from information in an Acme::CPANModules::* list

=head1 VERSION

This document describes version 0.245 of gen-bencher-scenario-from-cpanmodules (from Perl distribution App-BencherUtils), released on 2022-08-24.

=head1 SYNOPSIS

B<gen-bencher-scenario-from-cpanmodules> [B<--debug>|B<--log-level>=I<level>|B<--quiet>|B<--trace>|B<--verbose>] [B<--format>=I<name>|B<--json>] [B<--(no)naked-res>] [B<--page-result>[=I<program>]|B<--view-result>[=I<program>]] -- E<lt>I<cpanmodule>E...

=head1 DESCRIPTION

An L<Acme::CPANModules>::* module can contain benchmark information, for
example in L<Acme::CPANModules::TextTable>, each entry has the following
property:

   entries => [
       ...
       {
           module => 'Text::ANSITable',
           ...
           bench_code => sub {
               my ($table) = @_;
               my $t = Text::ANSITable->new(
                   use_utf8 => 0,
                   use_box_chars => 0,
                   use_color => 0,
                   columns => $table->[0],
                   border_style => 'Default::single_ascii',
               );
               $t->add_row($table->[$_]) for 1..@$table-1;
               $t->draw;
           },
 
           # per-function participant
           functions => {
               'func1' => {
                   bench_code_template => 'Text::ANSITable::func1([])',
               },
               ...
           },

The list also contains information about the benchmark datasets:

 bench_datasets => [
     {name=>'tiny (1x1)'    , argv => [_make_table( 1, 1)],},
     {name=>'small (3x5)'   , argv => [_make_table( 3, 5)],},
     {name=>'wide (30x5)'   , argv => [_make_table(30, 5)],},
     {name=>'long (3x300)'  , argv => [_make_table( 3, 300)],},
     {name=>'large (30x300)', argv => [_make_table(30, 300)],},
 ],

This routine extract those information and return a L<Bencher> scenario
structure.

=head1 OPTIONS

C<*> marks required options.

=head2 Main options

=over

=item B<--cpanmodule>=I<s>*



( run in 3.674 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )