The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mite::Manual::Benchmarking - comparing Mite with Moose, Moo, and Mouse

MANUAL

The relative performance of Moose, Moo, Mouse, and Mite will vary depending on your project.

However, as a general test I created 500 simple test classes, each with a couple of attributes with defaults and builders, and a method, then a script which loaded all the classes, instantiated an object of each, and called the method.

Here are the results, in seconds:

    Toolkit:   Mite
    Load time: 0.2665
    Run time:  0.0082
    
    Toolkit:   Moo
    Load time: 0.1684
    Run time:  0.0945
    
    Toolkit:   Moose
    Load time: 0.7862
    Run time:  0.0089
    
    Toolkit:   Mouse
    Load time: 0.0718
    Run time:  0.0045
    
    Toolkit:   Mouse (MOUSE_PUREPERL=1)
    Load time: 0.1186
    Run time:  0.0348

Mite is one of the slowest at load time, probably because each class requires loading two files instead of one. Only Moose is slower.

However, once it's running, Mite beats both Moo and the pure Perl version of Mouse, and runs at about the same speed as Moose. Only the XS version of Mouse runs significantly faster.

For most applications, running speed is likely to be more important than loading speed, especially as projects with this many classes are not common!

BUGS

Please report any bugs to https://github.com/tobyink/p5-mite/issues.

AUTHOR

Michael G Schwern <mschwern@cpan.org>.

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

This software is copyright (c) 2011-2014 by Michael G Schwern.

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

DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.