probably this could be interesting to OP and others (little self-promotion, sorry): http://blogs.perl.org/users/komarov/2010/01/undeclarepl-moosexdeclare---moose.html
On Fri, 22 Oct 2010 16:12:43 -0400 Stevan Little <[email protected]> wrote: > > On Oct 22, 2010, at 3:41 PM, Buddy Burden wrote: > > > Guys, > > > >> A more relevant > >> comparison and valuable discussion would be the difference in > >> overhead > >> between MX::Declare and plain old Moose. > > > > Also, am I incorrect in believing that _all_ the overhead of > > MX::Declare is in the startup? For instance, using it in a mod_perl > > environment (which I am here at $work), I'm going to pay that cost > > at Apache startup and nowhere else ... right? > > No, that is vanilla Moose which concentrates the cost in startup. > > With MooseX::Declare, you will pay in overhead for every method call > in MooseX::Declare in order to get the type checking. > > Piers Crawley described a technique at YAPC::NA this year whereby he > would use a combination of MooseX::Declare and (if I recall > correctly) Method::Signatures (or perhaps it was > Method::Signatures::Simple) so that he could get the method arg type > checking when he needed it with MX::Declare, but when speed was > needed he could just use Method::Signatures and get the parameter > handling without the typecheck overhead. > > Of course this doesn't affect the Moose generated accessors, only > methods you write using the "method" keyword that MX::Declare > provides. So I guess really the amount of runtime overhead is > directly proportional to how often you use that. > > - Stevan
