Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is make_immutable still valid advice with Perl 5.38? #119

Open
bbkr opened this issue Jul 20, 2023 · 0 comments
Open

Is make_immutable still valid advice with Perl 5.38? #119

bbkr opened this issue Jul 20, 2023 · 0 comments

Comments

@bbkr
Copy link

bbkr commented Jul 20, 2023

I have a feeling that two things became bonded:

  • Perl needed true value at the end of package.
  • Mouse needed syntax compatibility with Moose.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant