Is the performance hit with using MooseX::Declare mainly encountered while it does its initial magic (i.e. "translating" the definition into standard Perl syntax)? i.e. once the compile and initial runtime setup is complete, is there a performance difference in calling a MooseX::Declare method vs a method defined via traditional declaration?
The answer is yes and no. Since MooseX::Declare uses MooseX::Method::Signatures to do parameter unpacking and validation, there is a runtime overhead compared to not validating parameters at all.
But if your idea of "traditional declaration" includes validating the number and type of your parameters (and it should if you want robust code) then there's no reason to think that the validation MXD/MXMS does would be any slower than the validation you would do yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With