cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@apache.org>
Subject RE: [RT]: Calculating the cache key
Date Tue, 28 May 2002 12:55:38 GMT
> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de] 
> > There are two things you need to know about the default 
> hashCode() for 
> > this to work:
> >
> > 1) Default hash values are the address of the object--meaning that
> >    they are all aligned on a power of 2 ( typically every 4 or 8
> >    bytes depending on 32 or 64 bit machines ).
> >
> > 2) Very regular hash values (like the default) will heavily weight
> >    themselves to a particular buckets in the hash table (I 
> found this
> >    out creating the new BucketMap in Avalon collections).
> >
> > 3) You must ensure that the resultant hashCode is not an 
> even number,
> >    this will help ensure a more even distribution of 
> hashvalues.  (this
> >    is what the String hashCode tries to do).
> >
> > 4) The hashing algorithm must be quick--but it can be cashed for a
> >    quick access.  That way if multiple tests on the hashCode occur,
> >    you can save an expensive recalculation phase for each code.
> >
> You are a little bit behind this thread ;)
> 
> Volker and I discussed some of this already. The only thing 
> which might need some improvements is the implementation of 
> the hashCode() methods in the ComponentCacheKey and the 
> PipelineCacheKey implementations :)

Maybe so, but those things do need to be kept in mind.


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message