Boost logo

Boost :

Subject: Re: [boost] [hash] regular behaviour of hash function for double values
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-01-31 11:50:40


On Tuesday, January 31, 2012 11:19:29 Dave Abrahams wrote:
> on Tue Jan 31 2012, Olaf van der Spek <ml-AT-vdspek.org> wrote:
> > On Tue, Jan 31, 2012 at 4:10 PM, Kai Schroeder
> >
> > <kaischroeder3_at_[hidden]> wrote:
> >> Especially since some hash table implementations (e.g. intel's
> >> threading building blocks) only use the last few bits to determine the
> >> bucket, this can lead to very bad caching behaviour for the rather
> >> common case of regularly sampled points (equidistant samplings of
> >> power of 2 are e.g. common in computer graphics and numerical
> >> algorithms).
> >>
> >> Are you aware of this? Would you consider it a bug?
> >
> > Yes, sounds like a bug in TBB. I don't think it's a good idea to
> > discard bits.
>
> Perhaps not, but it seems to me that we have a problem, too.

In case you missed it, there was this [1] conversation which basically boiled
down to where bit mixing of the hash value should be implemented - in the hash
function or the container itself. The standard doesn't mandate this, AFAICT,
but my understanding is that it's the hash function's job.

[1] <http://news.gmane.org/find-
root.php?group=gmane.comp.lib.boost.devel&article=227609>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk