That's where the 'can be' part comes in :)
The point is that symbols support quicker lookup by their nature.
Whether they are quicker in practice will depend on the
implementation. From the timings you give, it looks like symbol lookup
is implemented by converting the symbol to a string and doing string
lookup. Which is obviously not quicker :)

My data were from a Common Lisp implementation, where symbols were
quicker in practice as well.
Sorry, didn't know about the Ruby implementation. Thanks for the info.


jf

On 12/28/05, ara.t.howard / noaa.gov <ara.t.howard / noaa.gov> wrote:
> On Thu, 29 Dec 2005, Johannes Friestad wrote:
>
>
> > Symbols are (or can be) quicker for hash lookup, since it is sufficient to
> > compare object identity to find whether two symbols are the same, while
> > strings must be compared character by character. You are unlikely to notice
> > the difference unless your program uses hashes heavily.
>
> i see this claim all the time but never data supporting it, all my test
> programs have shown the opposite to be true.  see