This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debug mode performance patch


On 11/19/2010 12:54 AM, Paolo Carlini wrote:
Hi,

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.
If there aren't other issues, I think the new Murmur hash is pretty good even when only a limited range of values is eventually computed. Matt told me that if only we could use it uniformly over *all* the std::hash specializations he would even feel comfortable with simplifying the unordered containers to use a power of two number of buckets. Anyway, in case if need, in the .cc file we also have a reference to the main Google web page.

Paolo
Well, I consider this code as a temporary limited workaround to the contention issue so I made it simple. Ideally a mutex should be associated to each safe sequence. Do you think that this workaround is going to last for a long time ? Otherwise I do not see the point of spending too much time on the best method to associate the mutex to the sequence.

FranÃois


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]