Issue #11127 has been updated by Charles Nutter.

Status changed from Open to Third Party's Issue

Nevermind.

----------------------------------------
Bug #11127: Symbol#== allocates at least one string, possibly two
https://bugs.ruby-lang.org/issues/11127#change-52338

* Author: Charles Nutter
* Status: Third Party's Issue
* Priority: Normal
* Assignee: 
* ruby -v: all versions
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Symbol#== is implemented by Comparable, which uses Symbol#<=>, which coerces the symbol to a String so it can use String#<=> logic.

Most people don't know this, but it adds many hidden allocations to any Symbol-heavy code that that's doing lots of == comparisons.

I propose that Symbol should define its own == that doesn't have to do the extra work for <=>. The other Comparable methods are not important because Symbols usually compared using == or ===.



-- 
https://bugs.ruby-lang.org/