Skip to content

Make the SHAPE_TOO_COMPLEX performance warning more actionable #9275

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

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

casperisfine
Copy link
Contributor

As suggested by @mame, we should try to help users fix the issues without having to lookup the meaning of the warning.

Copy link
Member

@mame mame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😇

As suggested by Mame, we should try to help users fix the issues
without having to lookup the meaning of the warning.
@casperisfine casperisfine force-pushed the improve-shape-perf-warning branch from 35ca889 to 5a0e4ae Compare December 18, 2023 09:04
@casperisfine casperisfine requested a review from mame December 18, 2023 09:04
@byroot byroot merged commit ba1d152 into ruby:master Dec 18, 2023
SHAPE_MAX_VARIATIONS,
rb_class_path(klass)
"The class %"PRIsVALUE" reached %d shape variations, instance variables accesses will be slower and memory usage increased.\n"
"It is recommended to define instance variable in a consistent order, for instance by eagerly defining them all in the `initialize` method.",
Copy link
Member

@eregon eregon Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but backquotes seem rare in Ruby exception/warning messages, here I think #initialize would be better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

4 participants