in reply to Re: A "Perl-7" that I could actually USE right now
in thread A "Perl-7" that I could actually USE right now
For what it's worth, Mouse is much more than 25% faster than Moose (at least it is on machines where it's been compiled with XS; Mouse::PurePerl is very slightly slower than Moose). While it appears to offer good compatibility with Moose; this is on the surface only. Things start to break if you try to consume a Mouse role in Moose, or extend a Moose class with Mouse.
Moo has far less of a start-up penalty than Moose, but when it comes to running speed, isn't quite as fast. On the surface it appears less Moose-compatible (but see MooX::late) but it's designed to be able to interact nicely with Moose. You can extend Moo classes with Moose, consume Moose roles in Moo, etc.
The only places I can see big scope for Moose optimization are:
- Allow inlining for things like defaults, triggers and coercions. This would slow down the speed at which your class loads, but improve the speed at which it runs.
- Rewrite large parts of the internals in XS. This would likely improve the speed of Moose itself, but not alter the speed of your class. (It would also make maintenance of Moose more annoying, and thus turn away developers.)
I've published a couple of modules on CPAN that might be of use if you're trying to eke a little more speed out of a lumbering Moose...
- Type::Tiny - a type constraint system that's a little faster than Moose's built-in ones. (I have benchmarked it.)
- MooseX::XSAccessor - which replaces some of your accessor methods with faster XS-based ones, but only when it detects that it can do so without breaking any functionality. (Again, I have benchmarked it.)
|
---|