PURPOSE

Compares the speed of the constructor in six 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.

Mouse

Mouse with Mouse type constraints. Class is made immutable. XS is switched off using MOUSE_PUREPERL environment variable.

Mouse_TT

Mouse with Type::Tiny type constraints. Class is made immutable. XS is switched off using MOUSE_PUREPERL environment variable.

RESULTS

In all cases, Type::Tiny type constraints are clearly faster than the conventional approach:

             Rate Moo_MXTML     Mouse     Moose    Moo_TT  Moose_TT  Mouse_TT
 Moo_MXTML 2947/s        --      -29%      -50%      -51%      -67%      -68%
 Mouse     4177/s       42%        --      -29%      -31%      -54%      -55%
 Moose     5910/s      101%       41%        --       -3%      -35%      -36%
 Moo_TT    6074/s      106%       45%        3%        --      -33%      -34%
 Moose_TT  9050/s      207%      117%       53%       49%        --       -2%
 Mouse_TT  9221/s      213%      121%       56%       52%        2%        --

(Tested versions: Type::Tiny 0.042, Moose 2.1107, Moo 1.004001, MooX::Types::MooseLike 0.23, and Mouse 2.1.0)

DEPENDENCIES

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

AUTHOR

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

This software is copyright (c) 2013-2014 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.