[issue18032] Optimization for set/frozenset.issubset()

2015-05-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In C implementation no need to create set object seen. More efficient way is to use bit array. Here is a patch that uses this approach. ./python -m timeit -s s1 = set(range(1000)) s1.issubset(range(1000)) Unpatched : 1 loops, best of 3: 115 usec per

[issue18032] Optimization for set/frozenset.issubset()

2015-05-27 Thread Bruno Cauet
Bruno Cauet added the comment: Serhiy, that sounds good but I think that you have forgotten to attach the mentioned patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18032 ___

[issue18032] Optimization for set/frozenset.issubset()

2015-05-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry. Here is it. -- Added file: http://bugs.python.org/file39516/set_issubset_bitarray.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18032 ___

[issue18032] Optimization for set/frozenset.issubset()

2015-05-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Personally I don't sure that this optimization is worth to apply. I concur. Closing as not worth it :-) -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue18032] Optimization for set/frozenset.issubset()

2015-05-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Personally I don't sure that this optimization is worth to apply. Its cost is high and optimized case is not common. This is rather an experiment, how large can be maximal effect of the optimization. -- ___

[issue18032] Optimization for set/frozenset.issubset()

2014-11-27 Thread Bruno Cauet
Bruno Cauet added the comment: Here is an updated patch based on Dustin's work with Josh's comments. I also added a test which takes forever on an unpatched python interpreter. Since it's a performance issue, I've benchmarked the results. They don't change for the most part (argument is a set

[issue18032] Optimization for set/frozenset.issubset()

2014-06-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: Patch needs some work. See comments on patch. -- nosy: +josh.rosenberg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18032 ___

[issue18032] Optimization for set/frozenset.issubset()

2014-06-22 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- title: set methods should specify whether they consume iterators lazily - Optimization for set/frozenset.issubset() ___ Python tracker rep...@bugs.python.org