Compares the speed of the constructor in four equivalent classes built using different tools:
Moo with MooX::Types::MooseLike::Base types.
Moo with Type::Tiny types.
Moose with Moose type constraints. Class is made immutable.
Moose with Type::Tiny type constraints. Class is made immutable.
In both Moo examples, the following patch was applied, which will hopefully make it into mainstream Moo releases soon.
http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Moo.git;a=commitdiff;h=2f425b5770149d4ed2e59da001c3be052cbd6bc1.
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 3140/s -- -47% -51% -62% Moo_TT 5947/s 89% -- -8% -28% Moose 6458/s 106% 9% -- -21% Moose_TT 8220/s 162% 38% 27% --
Moo, MooX::Types::MooseLike::Base, Moose.
Toby Inkster <tobyink@cpan.org>.
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.
To install Type::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Type::Tiny
CPAN shell
perl -MCPAN -e shell install Type::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.