package Bencher::Scenario::Accessors::GeneratorStartup;

our $DATE = '2021-08-03'; # DATE
our $VERSION = '0.150'; # VERSION

use Bencher::ScenarioUtil::Accessors;

my $classes = \%Bencher::ScenarioUtil::Accessors::classes;

our $scenario = {
    summary => 'Benchmark startup of various accessor generators',
    module_startup => 1,
    modules => {
    },
    participants => [
        map {
            my $spec = $classes->{$_};
            +{ (module=>$spec->{generator}) x !!$spec->{generator} };
        } keys %$classes,
    ],
};

1;
# ABSTRACT: Benchmark startup of various accessor generators

__END__

=pod

=encoding UTF-8

=head1 NAME

Bencher::Scenario::Accessors::GeneratorStartup - Benchmark startup of various accessor generators

=head1 VERSION

This document describes version 0.150 of Bencher::Scenario::Accessors::GeneratorStartup (from Perl distribution Bencher-Scenarios-Accessors), released on 2021-08-03.

=head1 SYNOPSIS

To run benchmark with default option:

 % bencher -m Accessors::GeneratorStartup

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

=head1 BENCHMARKED MODULES

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

L<Class::Accessor> 0.51

L<Class::Accessor::Array> 0.032

L<Class::Accessor::PackedString> 0.001

L<Class::Accessor::PackedString::Set> 0.001

L<Class::InsideOut> 1.14

L<Class::Struct> 0.66

L<Class::Tiny> 1.008

L<Class::XSAccessor> 1.19

L<Class::XSAccessor::Array> 1.19

L<Mo> 0.40

L<Mojo::Base>

L<Mojo::Base::XS> 0.07

L<Moo> 2.004004

L<Moops> 0.038

L<Moos> 0.30

L<Moose> 2.2015

L<Mouse> v2.5.10

L<Object::Pad> 0.46

L<Object::Simple> 3.19

L<Object::Tiny> 1.09

L<Object::Tiny::RW> 1.07

L<Object::Tiny::RW::XS> 0.04

L<Object::Tiny::XS> 1.01

L<Simple::Accessor> 1.13

=head1 BENCHMARK PARTICIPANTS

=over

=item * Class::Accessor::PackedString (perl_code)

L<Class::Accessor::PackedString>



=item * Class::Accessor::Array (perl_code)

L<Class::Accessor::Array>



=item * Mojo::Base (perl_code)

L<Mojo::Base>



=item * Object::Tiny (perl_code)

L<Object::Tiny>



=item * Simple::Accessor (perl_code)

L<Simple::Accessor>



=item * Object::Tiny::RW (perl_code)

L<Object::Tiny::RW>



=item * Moose (perl_code)

L<Moose>



=item *  (perl_code)



=item * Moos (perl_code)

L<Moos>



=item * Object::Pad (perl_code)

L<Object::Pad>



=item * Object::Tiny::XS (perl_code)

L<Object::Tiny::XS>



=item * Mouse (perl_code)

L<Mouse>



=item * Mo (perl_code)

L<Mo>



=item * Object::Simple (perl_code)

L<Object::Simple>



=item * Moops (perl_code)

L<Moops>



=item * Class::Struct (perl_code)

L<Class::Struct>



=item * Class::XSAccessor (perl_code)

L<Class::XSAccessor>



=item * Object::Tiny::RW::XS (perl_code)

L<Object::Tiny::RW::XS>



=item *  (perl_code)



=item * Moo (perl_code)

L<Moo>



=item * Class::InsideOut (perl_code)

L<Class::InsideOut>



=item * Mojo::Base::XS (perl_code)

L<Mojo::Base::XS>



=item * Class::Accessor (perl_code)

L<Class::Accessor>



=item * Class::Tiny (perl_code)

L<Class::Tiny>



=item *  (perl_code)



=item * Class::Accessor::PackedString::Set (perl_code)

L<Class::Accessor::PackedString::Set>



=item * Class::XSAccessor::Array (perl_code)

L<Class::XSAccessor::Array>



=back

=head1 BENCHMARK SAMPLE RESULTS

=head2 Sample benchmark #1

Run on: perl: I<< v5.34.0 >>, CPU: I<< Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (4 cores) >>, OS: I<< GNU/Linux LinuxMint version 19 >>, OS kernel: I<< Linux version 5.3.0-68-generic >>.

Benchmark command (default options):

 % bencher -m Accessors::GeneratorStartup

Result formatted as table:

 #table1#
 +------------------------------------+-----------+-------------------+-----------------------+-----------------------+-----------+---------+
 | participant                        | time (ms) | mod_overhead_time | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
 +------------------------------------+-----------+-------------------+-----------------------+-----------------------+-----------+---------+
 | Moose                              |       110 |               105 |                 0.00% |              2205.82% |   0.001   |      20 |
 | Mojo::Base                         |        90 |                85 |                33.47% |              1627.64% |   0.0014  |      20 |
 | Moops                              |        49 |                44 |               134.20% |               884.57% |   0.00029 |      20 |
 | Mouse                              |        21 |                16 |               435.12% |               330.90% |   0.00012 |      20 |
 | Moos                               |        20 |                15 |               621.73% |               219.48% |   0.0002  |      20 |
 | Class::InsideOut                   |        20 |                15 |               641.35% |               211.03% |   0.00017 |      20 |
 | Object::Pad                        |        10 |                 5 |               675.19% |               197.45% |   0.00026 |      20 |
 | Moo                                |        10 |                 5 |               698.91% |               188.62% |   0.00022 |      20 |
 | Class::Struct                      |        10 |                 5 |               790.59% |               158.91% |   0.00019 |      21 |
 | Class::XSAccessor                  |        10 |                 5 |               866.05% |               138.69% |   0.00019 |      22 |
 | Object::Simple                     |        10 |                 5 |               869.19% |               137.91% |   0.0002  |      21 |
 | Class::Accessor                    |        10 |                 5 |               873.51% |               136.86% |   0.00033 |      20 |
 | Object::Tiny::XS                   |        10 |                 5 |               887.20% |               133.57% |   0.00023 |      20 |
 | Object::Tiny::RW::XS               |        11 |                 6 |               903.19% |               129.85% | 6.9e-05   |      22 |
 | Class::XSAccessor::Array           |        10 |                 5 |               912.80% |               127.67% |   0.00024 |      20 |
 | Class::Tiny                        |        10 |                 5 |               929.62% |               123.95% |   0.00023 |      20 |
 | Mojo::Base::XS                     |         9 |                 4 |              1191.30% |                78.57% |   0.00018 |      21 |
 | Simple::Accessor                   |         8 |                 3 |              1351.97% |                58.81% |   0.00016 |      20 |
 | Mo                                 |         7 |                 2 |              1454.79% |                48.30% |   0.00025 |      20 |
 | Object::Tiny                       |         7 |                 2 |              1570.40% |                38.04% |   0.00011 |      20 |
 | Class::Accessor::PackedString      |         7 |                 2 |              1582.05% |                37.08% |   0.00014 |      20 |
 | Class::Accessor::PackedString::Set |         6 |                 1 |              1871.76% |                16.94% |   0.00012 |      22 |
 | Class::Accessor::Array             |         6 |                 1 |              1960.62% |                11.90% |   0.00019 |      21 |
 | Object::Tiny::RW                   |         5 |                 0 |              2159.08% |                 2.07% | 6.3e-05   |      20 |
 | perl -e1 (baseline)                |         5 |                 0 |              2205.82% |                 0.00% |   0.00017 |      21 |
 +------------------------------------+-----------+-------------------+-----------------------+-----------------------+-----------+---------+


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

                                         Rate  Moose  Mojo::Base  Moops  Mouse  Moos  Class::InsideOut  Object::Tiny::RW::XS  Object::Pad   Moo  Class::Struct  Class::XSAccessor  Object::Simple  Class::Accessor  Object::Tiny::XS  Class::XSAccessor::Array  Class::Tiny  Mojo::Base::XS  Simple::Accessor    Mo  Object::Tiny  Class::Accessor::PackedString  Class::Accessor::PackedString::Set  Class::Accessor::Array  Object::Tiny::RW  perl -e1 (baseline) 
  Moose                                 9.1/s     --        -18%   -55%   -80%  -81%              -81%                  -90%         -90%  -90%           -90%               -90%            -90%             -90%              -90%                      -90%         -90%            -91%              -92%  -93%          -93%                           -93%                                -94%                    -94%              -95%                 -95% 
  Mojo::Base                           11.1/s    22%          --   -45%   -76%  -77%              -77%                  -87%         -88%  -88%           -88%               -88%            -88%             -88%              -88%                      -88%         -88%            -90%              -91%  -92%          -92%                           -92%                                -93%                    -93%              -94%                 -94% 
  Moops                                20.4/s   124%         83%     --   -57%  -59%              -59%                  -77%         -79%  -79%           -79%               -79%            -79%             -79%              -79%                      -79%         -79%            -81%              -83%  -85%          -85%                           -85%                                -87%                    -87%              -89%                 -89% 
  Mouse                                47.6/s   423%        328%   133%     --   -4%               -4%                  -47%         -52%  -52%           -52%               -52%            -52%             -52%              -52%                      -52%         -52%            -57%              -61%  -66%          -66%                           -66%                                -71%                    -71%              -76%                 -76% 
  Moos                                 50.0/s   450%        350%   145%     5%    --                0%                  -44%         -50%  -50%           -50%               -50%            -50%             -50%              -50%                      -50%         -50%            -55%              -60%  -65%          -65%                           -65%                                -70%                    -70%              -75%                 -75% 
  Class::InsideOut                     50.0/s   450%        350%   145%     5%    0%                --                  -44%         -50%  -50%           -50%               -50%            -50%             -50%              -50%                      -50%         -50%            -55%              -60%  -65%          -65%                           -65%                                -70%                    -70%              -75%                 -75% 
  Object::Tiny::RW::XS                 90.9/s   900%        718%   345%    90%   81%               81%                    --          -9%   -9%            -9%                -9%             -9%              -9%               -9%                       -9%          -9%            -18%              -27%  -36%          -36%                           -36%                                -45%                    -45%              -54%                 -54% 
  Object::Pad                         100.0/s  1000%        800%   390%   110%  100%              100%                   10%           --    0%             0%                 0%              0%               0%                0%                        0%           0%             -9%              -19%  -30%          -30%                           -30%                                -40%                    -40%              -50%                 -50% 
  Moo                                 100.0/s  1000%        800%   390%   110%  100%              100%                   10%           0%    --             0%                 0%              0%               0%                0%                        0%           0%             -9%              -19%  -30%          -30%                           -30%                                -40%                    -40%              -50%                 -50% 
  Class::Struct                       100.0/s  1000%        800%   390%   110%  100%              100%                   10%           0%    0%             --                 0%              0%               0%                0%                        0%           0%             -9%              -19%  -30%          -30%                           -30%                                -40%                    -40%              -50%                 -50% 
  Class::XSAccessor                   100.0/s  1000%        800%   390%   110%  100%              100%                   10%           0%    0%             0%                 --              0%               0%                0%                        0%           0%             -9%              -19%  -30%          -30%                           -30%                                -40%                    -40%              -50%                 -50% 
  Object::Simple                      100.0/s  1000%        800%   390%   110%  100%              100%                   10%           0%    0%             0%                 0%              --               0%                0%                        0%           0%             -9%              -19%  -30%          -30%                           -30%                                -40%                    -40%              -50%                 -50% 
  Class::Accessor                     100.0/s  1000%        800%   390%   110%  100%              100%                   10%           0%    0%             0%                 0%              0%               --                0%                        0%           0%             -9%              -19%  -30%          -30%                           -30%                                -40%                    -40%              -50%                 -50% 
  Object::Tiny::XS                    100.0/s  1000%        800%   390%   110%  100%              100%                   10%           0%    0%             0%                 0%              0%               0%                --                        0%           0%             -9%              -19%  -30%          -30%                           -30%                                -40%                    -40%              -50%                 -50% 
  Class::XSAccessor::Array            100.0/s  1000%        800%   390%   110%  100%              100%                   10%           0%    0%             0%                 0%              0%               0%                0%                        --           0%             -9%              -19%  -30%          -30%                           -30%                                -40%                    -40%              -50%                 -50% 
  Class::Tiny                         100.0/s  1000%        800%   390%   110%  100%              100%                   10%           0%    0%             0%                 0%              0%               0%                0%                        0%           --             -9%              -19%  -30%          -30%                           -30%                                -40%                    -40%              -50%                 -50% 
  Mojo::Base::XS                      111.1/s  1122%        900%   444%   133%  122%              122%                   22%          11%   11%            11%                11%             11%              11%               11%                       11%          11%              --              -11%  -22%          -22%                           -22%                                -33%                    -33%              -44%                 -44% 
  Simple::Accessor                    125.0/s  1275%       1025%   512%   162%  150%              150%                   37%          25%   25%            25%                25%             25%              25%               25%                       25%          25%             12%                --  -12%          -12%                           -12%                                -25%                    -25%              -37%                 -37% 
  Mo                                  142.9/s  1471%       1185%   600%   200%  185%              185%                   57%          42%   42%            42%                42%             42%              42%               42%                       42%          42%             28%               14%    --            0%                             0%                                -14%                    -14%              -28%                 -28% 
  Object::Tiny                        142.9/s  1471%       1185%   600%   200%  185%              185%                   57%          42%   42%            42%                42%             42%              42%               42%                       42%          42%             28%               14%    0%            --                             0%                                -14%                    -14%              -28%                 -28% 
  Class::Accessor::PackedString       142.9/s  1471%       1185%   600%   200%  185%              185%                   57%          42%   42%            42%                42%             42%              42%               42%                       42%          42%             28%               14%    0%            0%                             --                                -14%                    -14%              -28%                 -28% 
  Class::Accessor::PackedString::Set  166.7/s  1733%       1400%   716%   250%  233%              233%                   83%          66%   66%            66%                66%             66%              66%               66%                       66%          66%             50%               33%   16%           16%                            16%                                  --                      0%              -16%                 -16% 
  Class::Accessor::Array              166.7/s  1733%       1400%   716%   250%  233%              233%                   83%          66%   66%            66%                66%             66%              66%               66%                       66%          66%             50%               33%   16%           16%                            16%                                  0%                      --              -16%                 -16% 
  Object::Tiny::RW                    200.0/s  2100%       1700%   880%   320%  300%              300%                  120%         100%  100%           100%               100%            100%             100%              100%                      100%         100%             80%               60%   39%           39%                            39%                                 19%                     19%                --                   0% 
  perl -e1 (baseline)                 200.0/s  2100%       1700%   880%   320%  300%              300%                  120%         100%  100%           100%               100%            100%             100%              100%                      100%         100%             80%               60%   39%           39%                            39%                                 19%                     19%                0%                   -- 
 
 Legends:
   Class::Accessor: mod_overhead_time=5 participant=Class::Accessor
   Class::Accessor::Array: mod_overhead_time=1 participant=Class::Accessor::Array
   Class::Accessor::PackedString: mod_overhead_time=2 participant=Class::Accessor::PackedString
   Class::Accessor::PackedString::Set: mod_overhead_time=1 participant=Class::Accessor::PackedString::Set
   Class::InsideOut: mod_overhead_time=15 participant=Class::InsideOut
   Class::Struct: mod_overhead_time=5 participant=Class::Struct
   Class::Tiny: mod_overhead_time=5 participant=Class::Tiny
   Class::XSAccessor: mod_overhead_time=5 participant=Class::XSAccessor
   Class::XSAccessor::Array: mod_overhead_time=5 participant=Class::XSAccessor::Array
   Mo: mod_overhead_time=2 participant=Mo
   Mojo::Base: mod_overhead_time=85 participant=Mojo::Base
   Mojo::Base::XS: mod_overhead_time=4 participant=Mojo::Base::XS
   Moo: mod_overhead_time=5 participant=Moo
   Moops: mod_overhead_time=44 participant=Moops
   Moos: mod_overhead_time=15 participant=Moos
   Moose: mod_overhead_time=105 participant=Moose
   Mouse: mod_overhead_time=16 participant=Mouse
   Object::Pad: mod_overhead_time=5 participant=Object::Pad
   Object::Simple: mod_overhead_time=5 participant=Object::Simple
   Object::Tiny: mod_overhead_time=2 participant=Object::Tiny
   Object::Tiny::RW: mod_overhead_time=0 participant=Object::Tiny::RW
   Object::Tiny::RW::XS: mod_overhead_time=6 participant=Object::Tiny::RW::XS
   Object::Tiny::XS: mod_overhead_time=5 participant=Object::Tiny::XS
   Simple::Accessor: mod_overhead_time=3 participant=Simple::Accessor
   perl -e1 (baseline): mod_overhead_time=0 participant=perl -e1 (baseline)

The above result presented as chart:

=begin html

<img src="data:image/png;base64, " />

=end html


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-Scenarios-Accessors>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-Bencher-Scenarios-Accessors>.

=head1 BUGS

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

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.

=head1 SEE ALSO

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 COPYRIGHT AND LICENSE

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

=cut
