[Catalyst] Re: OT: Use the CPAN, Luke?

Dave Rolsky autarch at urth.org
Fri Nov 28 04:40:06 GMT 2008

On Fri, 28 Nov 2008, Johan Lindstr?m wrote:

> At 06:58 2008-11-27, Aristotle Pagaltzis wrote:
>> > According to the Mouse docs, Mouse supports the most commonly
>> > used  features of Moose, but runs in 25% of the time. I'm happy
> I think that may be referring to startup time (and the Mouse POD refers to 
> compile time actually).
> In the context of web apps, if you're interested in performance at all, 
> you're obviously not going to use CGI. It's gonna be a persistent 
> environment. So in that scenario, startup cost is irrelevant.
> I benchmarked a few OO/accessor modules, and Mouse was amongst the slowest 
> ones. IIRC there's a 4:1 performance difference between Mouse and immutable 
> Moose classes (mutable Moose classes is a disaster, a few percent slower than 
> Mouse I think it was). So you make Moose classes immutable.
> The benchmark wasn't scientific or anything, basically just a new() with some 
> of the default values overridden in the call + a getter access. I think Moose 
> was something like 20% behind Class::Accessor::Fast and Spiffy was really 
> fast.
> Like the Moose docs say, you pay for what you use. In this case, when I added 
> type constraints they became the most expensive things beyond the basics, but 
> still as performant as hand coding the validation.

I'm pretty sure that Moose (especially when making one's classes 
immutable) has a much bigger _compile_ time hit than Mouse. OTOH, Moose's 
immutabilized constructor is faster than Mouse's.

I think the optimal use case for Mouse is something in a process that gets 
started a lot (a CLI app, for example). In that case, the compile time 
savings can easily outweight the runtime loss.


http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)

More information about the Catalyst mailing list