[issue18771] Reduce the cost of hash collisions for set objects

Raymond Hettinger report at bugs.python.org
Sun Aug 18 18:54:55 CEST 2013


Raymond Hettinger added the comment:

> Instead of only a second lookup, could you try for example 4 lookup
> and align j to fit in a cache line? 

Accessing 4 entries per probe is a tempting line of development, but will be subject to diminishing returns (second and third collisions aren't frequent).

I like the idea of aligning j to fit in a cache line, but the computation would need to be cheap and portable (standard C with no pointer tricks that rely on non-guaranteed behavior).

Have you had a chance to run the benchmarks on your machine?  I'm curious how this works out on other processors and with other compilers.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18771>
_______________________________________


More information about the Python-bugs-list mailing list