debug mode performance patch

Jonathan Wakely jwakely.gcc@gmail.com
Thu Nov 18 23:42:00 GMT 2010


On 18 November 2010 21:36, Paolo Carlini wrote:
> Hi,
>
>> Is there a problem if I simply always use unsigned long long ?
>
> If I remember well your specific case, probably not. By the way, did you consider hashing the address (by _Hash_bytes, like in <typeinfo>)?

I thought about suggesting that too. François's improved get_mutex
function only uses the lowest few bits, and I don't know how well
Hash_bytes works if you don't use the whole value ... probably still
better distributed than simply taking the address, and might avoid
pathological cases where distinct pairs of objects always get the same
two mutexes.

Without doing some tests I don't know, so using unsigned long long is
an improvement over just unsigned long.



More information about the Libstdc++ mailing list