The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

PURPOSE

Compares the speed of the constructor in four equivalent classes built using different tools:

Moo_MXTML

Moo with MooX::Types::MooseLike::Base types.

Moo_TT

Moo with Type::Tiny types.

Moose

Moose with Moose type constraints. Class is made immutable.

Moose_TT

Moose with Type::Tiny type constraints. Class is made immutable.

        =back

RESULTS

For both Moose and Moo, Type::Tiny type constraints are clearly faster than the conventional approach:

               Rate Moo_MXTML    Moo_TT     Moose  Moose_TT
   Moo_MXTML 3082/s        --      -49%      -52%      -63%
   Moo_TT    6053/s       96%        --       -6%      -27%
   Moose     6458/s      110%        7%        --      -22%
   Moose_TT  8295/s      169%       37%       28%        --

(Tested versions: Type::Tiny 0.003_16, Moose 2.0604, Moo 1.002000, and MooX::Types::MooseLike 0.16.)

DEPENDENCIES

Moo, MooX::Types::MooseLike::Base, Moose.

AUTHOR

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

This software is copyright (c) 2013 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 30:

You forgot a '=back' before '=head1'