Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: later - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23290
Roundup Robot added the comment:
New changeset 79c884cc9625 by Raymond Hettinger in branch 'default':
Issue #23290: Optimize set_merge() for cases where the target is empty.
https://hg.python.org/cpython/rev/79c884cc9625
--
nosy: +python-dev
___
Serhiy Storchaka added the comment:
Except one error (the declaration after the code), the patch LGTM. It is shame
to me that I left so much non-optimized code in specialized loops.
The result of my microbenchmarks is the speed up 51%, 153%, 23% and 96%
respectively.
--
Raymond Hettinger added the comment:
I don't like the patch as-is (comment change is wrong, test in the inner-loop
making the common case pay for a short-cut for the uncommon case). As I said
before, the basic idea is good and I will very likely include some variant of
this for Python3.5.
I
Serhiy Storchaka added the comment:
Doesn't the feature freeze start from beta 1?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23290
___
___
Raymond Hettinger added the comment:
Optimizations aren't new features. We can still tweak the implementation
through-out the betas.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23290
Raymond Hettinger added the comment:
I looked at the patch again and it is in pretty good shape.
Please hoist the conditionals out of the loop (for intelligibility and to let
the compiler in-line more effectively). Also, let's remove the dump and
clear variable names in favor of comments
Serhiy Storchaka added the comment:
Here is the patch with hoisted the conditionals out of the loop.
New microbenchmarking results:
$ ./python -m timeit -s s = set(range(10**4)) -- frozenset(s)
Unpatched: 1000 loops, best of 3: 407 usec per loop
With patch #4: 1000 loops, best of 3: 325
Antoine Pitrou added the comment:
Le 12/05/2015 20:55, Raymond Hettinger a écrit :
Optimizations aren't new features. We can still tweak the implementation
through-out the betas.
Not really. The period after the first beta is for fixing bugs, not for
risking introducing new bugs.
Serhiy Storchaka added the comment:
Could you please pay a little attention to this issue Raymond?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23290
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
Added file: http://bugs.python.org/file39353/set_faster_copy_6.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23290
___
Raymond Hettinger added the comment:
Attaching a variant with several fix-ups (mostly minor):
* Changed the order of the three sections to go from
most-restricted-most-optimized to the general-fall-through case. The downside
is that we test so-fill==0 twice. The upside is that it
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
Removed file: http://bugs.python.org/file39352/set_faster_copy_6.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23290
___
Serhiy Storchaka added the comment:
Updated patch addresses Victor's comment. Thank you for your review Victor.
Is msg234811 the result of set_faster_copy_3.patch?
Yes, it is. There are tests for sets with small and large number of hash
conflicts, with and without dummy objects. The patch
STINNER Victor added the comment:
New patch looks good to me. Great job on speedup. I didn't expect that it's
still possible to enhance set.
By the way, is it possible to report latest enhancement to the dict type? I
don't remember if tou tried that richard?
--
Serhiy Storchaka added the comment:
I didn't expect that it's still possible to enhance set.
Raymond made a lot of set optimizations recently.
By the way, is it possible to report latest enhancement to the dict type? I
don't remember if tou tried that richard?
May be when Raymond port his
STINNER Victor added the comment:
Is msg234811 the result of set_faster_copy_3.patch? If yes, I see no reason to
not apply the patch: the patch is short and looks always fast, and sometimes
*much* faster.
I just leaved a small comment on the review.
--
nosy: +haypo
Serhiy Storchaka added the comment:
Ping. The last patch doesn't add more lookkey variants, it uses existing
function.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23290
___
Raymond Hettinger added the comment:
I still intend to apply some variant of your patch. Am still looking at the
options.
--
priority: normal - low
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23290
Serhiy Storchaka added the comment:
Actually set_find_free_slot() is not needed because there is
set_insert_clean(). Results with using set_insert_clean():
$ ./python -m timeit -s s = set(range(10**4)) -- frozenset(s)
Unpatched: 1000 loops, best of 3: 700 usec per loop
Patched: 1000 loops,
Raymond Hettinger added the comment:
For the time being (while I working on other parts of sets), I'm holding-off an
anything that adds more lookkey variants. When the neatening-up and tweaking
of search routines comes to a close, I'll revisit this one because it looks
like there is a some
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23290
___
___
Serhiy Storchaka added the comment:
Here is even faster patch. When there are no dummies in source set we can just
dump a table, placing entries at the same indices.
$ ./python -m timeit -s s = set(range(10**4)) -- frozenset(s)
Unpatched: 1000 loops, best of 3: 658 usec per loop
Patched: 1000
New submission from Serhiy Storchaka:
Proposed patch makes faster creating new set from other set. The benefit is
only few percents when there are no hash conflicts, but can be significant if
there are hash duplicates.
$ ./python -m timeit -s s = set(range(10**4)) -- frozenset(s)
Unpatched:
Changes by Serhiy Storchaka storch...@gmail.com:
--
keywords: +patch
nosy: +pitrou, rhettinger
Added file: http://bugs.python.org/file37807/set_faster_copy.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23290
25 matches
Mail list logo