NAME
Bencher::Scenario::Accessors::GeneratorStartup - Benchmark startup of various accessor generators
VERSION
This document describes version 0.150 of Bencher::Scenario::Accessors::GeneratorStartup (from Perl distribution Bencher-Scenarios-Accessors), released on 2021-08-03.
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 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.
Class::Accessor 0.51
Class::Accessor::Array 0.032
Class::Accessor::PackedString 0.001
Class::Accessor::PackedString::Set 0.001
Class::InsideOut 1.14
Class::Struct 0.66
Class::Tiny 1.008
Class::XSAccessor 1.19
Mo 0.40
Mojo::Base::XS 0.07
Moo 2.004004
Moops 0.038
Moos 0.30
Moose 2.2015
Mouse v2.5.10
Object::Pad 0.46
Object::Simple 3.19
Object::Tiny 1.09
Object::Tiny::RW 1.07
Object::Tiny::RW::XS 0.04
Object::Tiny::XS 1.01
Simple::Accessor 1.13
BENCHMARK PARTICIPANTS
Class::Accessor::PackedString (perl_code)
Class::Accessor::Array (perl_code)
Mojo::Base (perl_code)
Object::Tiny (perl_code)
Simple::Accessor (perl_code)
Object::Tiny::RW (perl_code)
Moose (perl_code)
(perl_code)
Moos (perl_code)
Object::Pad (perl_code)
Object::Tiny::XS (perl_code)
Mouse (perl_code)
Mo (perl_code)
Object::Simple (perl_code)
Moops (perl_code)
Class::Struct (perl_code)
Class::XSAccessor (perl_code)
Object::Tiny::RW::XS (perl_code)
(perl_code)
Moo (perl_code)
Class::InsideOut (perl_code)
Mojo::Base::XS (perl_code)
Class::Accessor (perl_code)
Class::Tiny (perl_code)
(perl_code)
Class::Accessor::PackedString::Set (perl_code)
Class::XSAccessor::Array (perl_code)
BENCHMARK SAMPLE RESULTS
Sample benchmark #1
Run on: perl: v5.34.0, CPU: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (4 cores), OS: GNU/Linux LinuxMint version 19, OS kernel: 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 Benchmark.pm 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:
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-Accessors.
SOURCE
Source repository is at https://github.com/perlancar/perl-Bencher-Scenarios-Accessors.
BUGS
Please report any bugs or feature requests on the bugtracker website 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.
SEE ALSO
AUTHOR
perlancar <perlancar@cpan.org>
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.