Mite::Manual::Benchmarking - comparing Mite with Moose, Moo, and Mouse
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:
Load time: 0.2665
Run time: 0.0082
Load time: 0.1684
Run time: 0.0945
Load time: 0.7862
Run time: 0.0089
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!
Please report any bugs to https://github.com/tobyink/p5-mite/issues.
Michael G Schwern <firstname.lastname@example.org>.
Toby Inkster <email@example.com>.
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.
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.
To install Mite, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.