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

Johan Lindström johanl at DarSerMan.com
Fri Nov 28 01:31:41 GMT 2008

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.


More information about the Catalyst mailing list