From: "Eregon (Benoit Daloze) via ruby-core" Date: 2023-04-13T15:24:37+00:00 Subject: [ruby-core:113226] [Ruby master Feature#19538] Performance warnings Issue #19538 has been updated by Eregon (Benoit Daloze). Thank you, makes sense. Of course these performance warnings might differ per Ruby implementation. I thought `-w` should enable them but it seems multiple people disagree, OK. What about megamorphic method lookup? I guess the problem there is CRuby has no way to detect that due to monomophic caches? CRuby can detect singleton class creation though. Maybe we could warn for singleton classes but only if it happens more than some threshold (e.g. 10) per superclass of that singleton class (and ignore it if superclass is Class). WDYT? ---------------------------------------- Feature #19538: Performance warnings https://bugs.ruby-lang.org/issues/19538#change-102772 * Author: byroot (Jean Boussier) * Status: Closed * 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/