Hacker News new | ask | show | jobs
by markcampbell 4223 days 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.

2 comments

You're right. Also they symbols won't be garbage collected if they are currently keys in a hash.
symbols should also be instantiated at most once causing possible memory savings, but recent rubys should do that for frozen strings too.