[issue8425] a -= b should be fast if a is a small set and b is a large set

Michele Orrù report at bugs.python.org
Sun Sep 23 17:59:37 CEST 2012


Michele Orrù added the comment:

Something like this would also need unit tests?

$ ./python.exe -m timeit -s "s= set(range(2000)); l = set(range(20000000)); s=s-l"
10000000 loops, best of 3: 0.0622 usec per loop
[48787 refs]
$ ./python.exe -m timeit -s "s= set(range(2000)); l = set(range(20000000)); s-=l"
10000000 loops, best of 3: 0.0591 usec per loop
[48787 refs]

----------
Added file: http://bugs.python.org/file27265/issue8425.patch

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


More information about the Python-bugs-list mailing list