xslate / p5-Mouse

Lightweight class builder for Perl, as a subset of Moose
https://metacpan.org/release/Mouse
Other
46 stars 32 forks source link

Is make_immutable still valid advice with Perl 5.38? #119

Open bbkr opened 12 months ago

bbkr commented 12 months ago

I have a feeling that two things became bonded:

So despite the fact that in Mouse there is no real performance gain by declaring class as immutable (in Moose the speedup is 10x) ending Mouse packages with __PACKAGE__->meta->make_immutable became recommenced in documentation as a neat way to kill 2 birds with 1 stone.

This changes in Perl 5.38, which no longer needs true value at the end of package. I'm thinking about mass-removing hundreds of those make_immutable lines from my codebase running exclusively on 5.38 to reduce code noise. Is this reasonable approach if I do not need classes to be explicitly immutable? Does mutability has any performance penalty in some edge case scenarios or any other side effects that justifies making every class immutable as documentation suggests?

So this is not issue about Mouse itself, I'm just wondering if what documentation suggests is still valid advice.