From: "byroot (Jean Boussier) via ruby-core" Date: 2024-04-16T06:25:04+00:00 Subject: [ruby-core:117523] [Ruby master Feature#20429] Emit a performance warning when specially optimized core methods are redefined Issue #20429 has been reported by byroot (Jean Boussier). ---------------------------------------- Feature #20429: Emit a performance warning when specially optimized core methods are redefined https://bugs.ruby-lang.org/issues/20429 * Author: byroot (Jean Boussier) * Status: Open ---------------------------------------- MRI has a number of core methods with special handling in the interpreter and both JITs that if they are redefined negatively impact Ruby performance. The methods currently are (I may be missing a few): - `Integer`: `#+`, `#-`, `#*`, `#/`, `#%`, `#<`, `#>`, `#<=`, `#>=` - `Float`: `#+`, `#-`, `#*`, `#/`, `#<`, `#>`, `#<=`, `#>=` - `String`: `#freeze`, `#size`, `#length`, `#empty?`, `#+`, `#succ`, `#%`, `#-@` - `Array`: `#size`, `#length`, `#empty?`, `#hash` - `Array`: `#size`, `#length`, `#empty?`, `#[]`, `#[]=` -- 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/