The Moose metaclass API provides a method make_immutable(). At a high level, this calling this method does two things to your class. One, it makes it faster. In particular, object construction and accessors are effectively "inlined" in your class, and no longer go through the meta-object system.

Second, you can no longer make changes via the metaclass API such as adding attributes. In practice, this won't be a problem, as you don't usually need to do this at runtime after first loading the class.

If you override new() in your class, then the immutabilization code will not be able to provide an optimized constructor for your class. Instead, consider providing a BUILD() method. You can probably do the same thing in a BUILD() method.

Alternately, if you really need to provide a different new(), you can also provide your own immutabilization method.

We strongly recommend you make your classes immutable. It makes your code much faster, basically for free. This will be especially noticeable when creating many objects or calling accessors frequently.