
I have found that this behaviour of boost hash is described in the documentation: http://www.boost.org/doc/libs/1_48_0/doc/html/hash/rationale.html So, this is by design. This rationale is understandable, however it can lead to difficult to find performance problems as in our case. Btw.: std::hash in MSVC10 does not show this behaviour. Well, I tend to agree that this is a bug in TBB, still I would personally prefer a better hash function (even if it is a bit slower) by default. Maybe a fast_hash option could be provided as an alternative. Best regards, Kai On 1/31/12, Olaf van der Spek <ml@vdspek.org> wrote:
On Tue, Jan 31, 2012 at 4:10 PM, Kai Schroeder <kaischroeder3@googlemail.com> 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.
Olaf
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost