On 24 Oct 2012, at 05:35, Toby Corkindale wrote:
I was just wondering.. should we be adding Moose's make_immutable call
to the end of these classes?
This makes things faster if you construct lots of them (and also makes things a
bit safer, as they can't be changed), at the cost of a bit of startup time.
Generally Catalyst components are only initialised once (i.e. they're scoped to
the lifetime of the app), so there is no speed benefit to immutable in this
case (actually, it's probably a startup speed reduction), but I still tend to
use it for the safety…
So it's entirely optional, in classes which implement ACCEPT_CONTEXT (and so
are constructed once per request), you will see a speed benefit from doing it,
but this is the less unusual case..
Searchable archive: http://email@example.com/
Dev site: http://dev.catalyst.perl.org/