HashBits, a lazy way

Ned Konz ned at bike-nomad.com
Fri Jul 11 05:00:56 UTC 2003


On Thursday 10 July 2003 08:45 pm, Andres Valloud wrote:
> I don't understand.  On one hand, the identity hash bits are in the
> header so that access is super fast when they're needed (e.g.
> method lookup).  On the other hand, adding a conditional branch
> seems like it will slow down every single access.  ???... does that
> pay more than calculating/storing identity hashes for all objects?

No, he's saying that we don't need hash bits most of the time for most 
objects, so why bother to compute them?

Doing a comparison with 0 on the hash (when asked for the hash) is 
very cheap. Computing the hash is not.

In the case of symbols, we could skip the test if we could quickly 
tell if something were a symbol. I don't know if we have a flag bit 
for these. We could always compute the hash for symbols.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list