Object: Identity vs. Environment
joel at ikestrel.com
Thu May 29 07:37:53 UTC 2003
> I realized just after I sent it that it would be two as you say. So what
> you're saying is that it is ONLY an optimization? If so, why not just use
> Object>>#respondsTo? That should be able to have the same performance as a
> method dispatch shouldn't it? It is conceptually equivalent to
> Object>>#isFoo, and it still similarly distinguishes everything that is a
Ack! I made the same mistake again. Sorry. Yes, it would require a method
lookup for #respondsTo and then #respondsTo would have to do the actual
lookup (which would then could be as fast as a single lookup).
However, if it's only an optimization, then shouldn't it be in the realms of
an optimization hack, useful if your profiler says that you should do it but
otherwise to be avoided?
More information about the Squeak-dev