I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-12-14 11:04:30-08 by silvercat
how to speed up Moose ?
We all know that speed is an issue for Moose. What makes it faster a bit, is known as:

__PACKAGE__->meta->make_immutable

But this is not enough for slightly bigger projects.

The problem has been reviewed while discussing Moose + CGI (http://groups.google.com/group/perl-appengine/browse_thread/thread/f6cdbc3fc06391b4?pli=1), however no constructive answers were given.

Is there any other way, besides making a class immutable, to speed up Moose?

best,
silvercat
Direct Responses: 11945 | Write a response
Posted on 2009-12-14 13:53:15-08 by stvn in response to 11942
Re: how to speed up Moose ?
Making objects immutable will speed up the runtime, at the cost of a slightly extra compile time hit. There is plenty of work going on to speed up Moose though. The XS work being done on Mouse is planned to be eventually moved over to Moose (gfx is "prototyping" his ideas in Mouse), and Matt Trout is working on making Moose classes "compile" (see his recent blog entry for more info - http://www.shadowcat.co.uk/blog/matt-s-trout/shaving-a-moose/).
Beyond that, I suggest profiling with NYTProf and looking to see where the problem areas are. Some features in Moose cost more then others, for instance, method-modifiers can be expensive since they wrap your sub-calls, and complex type constraints also add some overhead. But without knowing more about your code, there isn't much else I can say.
Also, please note that the Moose community does not watch CPAN-Forums, you will find much more help on either the mailing list or on IRC.
Direct Responses: Write a response