[issue23282] Slightly faster set lookup

Serhiy Storchaka report at bugs.python.org
Sun Jan 25 20:55:50 CET 2015


Serhiy Storchaka added the comment:

What about just removing the dummy test inside the hash test? The benefit is smaller but statistically sygnificant and always positive.

$ ./python -m timeit -s "a = list(range(10**6)); s1 = set(a); s2 = set(a)" -- "s1 <= s2"

Unpatched: 10 loops, best of 3: 39.3 msec per loop
Patched: 10 loops, best of 3: 38.7 msec per loop

----------

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


More information about the Python-bugs-list mailing list