Boost logo

Boost :

Subject: Re: [boost] [hash] regular behaviour of hash function for double values
From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2012-02-01 12:59:10

[Howard Hinnant]
> On modern hardware expensive things to do include flushing the L1 cache and allocating memory.
> By comparison, individual instructions (except for memory barriers) are practically free.

Integer divisions are surprisingly expensive, relatively speaking. While changing deque, we introduced integer divisions that noticeably harmed performance. We got rid of them (restoring the perf and then some) by introducing a power-of-2 guarantee that let us use bitwise operations instead.

Of course, this will only matter in very high performance code, like the fundamental operations performed by a container.


Boost list run by bdawes at, gregod at, cpdaniel at, john at