From: "byroot (Jean Boussier) via ruby-core" Date: 2023-03-17T19:23:07+00:00 Subject: [ruby-core:112936] [Ruby master Feature#19538] Performance warnings Issue #19538 has been updated by byroot (Jean Boussier). So the example that sparked the idea was SHAPE_TOO_COMPLEX. It would be useful to emit a warning such as: `warning: SomeClass has too many shapes`. Other potential ideas could be to warn when constant caches are invalidated, or thing like that. However there is probably a complicated balance to find between relevance and verbosity. ---------------------------------------- Feature #19538: Performance warnings https://bugs.ruby-lang.org/issues/19538#change-102458 * Author: byroot (Jean Boussier) * Status: Open * Priority: Normal ---------------------------------------- Suggested by @Eregon. There are program behaviors that are supported, but that we know aren't good for performance, however it's hard for users to know about them. Now that we have warning categories, we could add a `:performance` category to allow the VM to emit warning in some situations. The category would be disabled by default, and users interested in optimizing their program could turn it on in development. ```ruby Warning[:performance] = true ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/