[ruby-core:117523] [Ruby master Feature#20429] Emit a performance warning when specially optimized core methods are redefined
From:
"byroot (Jean Boussier) via ruby-core" <ruby-core@...>
Date:
2024-04-16 06:25:04 UTC
List:
ruby-core #117523
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 -- [email protected] To unsubscribe send an email to [email protected] ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/