From: matz@... (Yukihiro Matsumoto) Date: 2001-06-22T15:44:44+09:00 Subject: [ruby-talk:16749] Re: Symbols, and their use as hash keys Hi, In message "[ruby-talk:16748] Symbols, and their use as hash keys" on 01/06/22, "Aristarkh A Zagorodnikov" writes: | May anyone enlighten me with knowledge of how symbol integer value |(Symbol#to_i) is generated ? You're not suppose to understand that. ;-) But if you really want to know the hidden magic, you can read rb_intern() int parse.y and ID2SYM() in ruby.h | Also, I'm interested why using it as a hash key is about 5-8 times slower |then string of the same size ? Symbols are immediate numbers. We can compare them in one machine operation, instead of byte by byte comparison like strings. matz.