From: "tmm1 (Aman Gupta)" Date: 2013-11-27T13:00:33+09:00 Subject: [ruby-core:58624] [ruby-trunk - Feature #8998] string keys for hash literals should use fstrings Issue #8998 has been updated by tmm1 (Aman Gupta). I didn't realize MRI already froze string keys in hashes. Your patch reduces long-lived strings in our rails app by ~11%: $ ruby -rconfig/environment -e' GC.start; p ObjectSpace.count_objects[:T_STRING] ' 173956 $ ruby -rconfig/environment -e' GC.start; p ObjectSpace.count_objects[:T_STRING] ' 154750 I am inclined to merge it. ---------------------------------------- Feature #8998: string keys for hash literals should use fstrings https://bugs.ruby-lang.org/issues/8998#change-43193 Author: normalperson (Eric Wong) Status: Open Priority: Low Assignee: Category: core Target version: current: 2.1.0 While we're introducing optimizations from frozen strings, string keys inside hashes should be frozen at the compiler level to prevent duplication. a = { "ABC" => :t } b = { "ABC" => :t } # the following ought to print true p(a.keys[0].object_id == b.keys[0].object_id) This should introduce no incompatibilities and be transparent to users of older rubies. -- http://bugs.ruby-lang.org/