top | item 8637230

(no title)

markcampbell | 11 years ago

I don't think persistence in memory was the selling point. The other selling point is that doing comparisons are faster because `:a == :a` can compare on a memory address while `'a' == 'a'` requires comparing the data at the different memory addresses.

Someone tell me I'm wrong.

discuss

order

reconbot|11 years ago

You're right. Also they symbols won't be garbage collected if they are currently keys in a hash.

riffraff|11 years ago

symbols should also be instantiated at most once causing possible memory savings, but recent rubys should do that for frozen strings too.