Serhiy Storchaka added the comment:
Why you have added entry-hash == 0?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23359
___
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23359
___
Roundup Robot added the comment:
New changeset cd1e1715becd by Raymond Hettinger in branch 'default':
Issue #23359: Specialize set_lookkey intoa lookup function and an insert
function.
https://hg.python.org/cpython/rev/cd1e1715becd
--
___
Python
Raymond Hettinger added the comment:
[Reply to pitrou that I didn't seem to be able to make on Rietveld]
This part of the code is the most time sensitive and warrants expansion much
more than other proposals (set copying, subset tests, etc). I long aspired to
split the lookup and insertion
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
versions: +Python 3.6 -Python 3.5
Added file: http://bugs.python.org/file39505/nd_lookkey_insertkey3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23359
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
Added file: http://bugs.python.org/file39510/new_set_timings.txt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23359
___
Roundup Robot added the comment:
New changeset 17cda5a92b6a by Raymond Hettinger in branch 'default':
Issue 23359: Reduce size of code in set_lookkey. Only do linear probes when
there is no wrap-around.
https://hg.python.org/cpython/rev/17cda5a92b6a
--
Raymond Hettinger added the comment:
Thanks Serhiy, that was brilliant.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23359
___
___
Raymond Hettinger added the comment:
Before doing more study on the other variants, I would like to get the second
transformation done (avoiding the mask computation in the case where there is
no wrap-around). Attaching a patch for just that step.
--
Added file:
Serhiy Storchaka added the comment:
Agree, applying simple steps one by one would be more robust. How large the
benefit, do you have any timing results?
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23359
Roundup Robot added the comment:
New changeset 0b3bc51341aa by Raymond Hettinger in branch 'default':
Issue 23359: Tighten inner search loop for sets (don't and-mask every entry
lookup).
https://hg.python.org/cpython/rev/0b3bc51341aa
--
nosy: +python-dev
Serhiy Storchaka added the comment:
May be the code can be simplified without affecting performance if remove
slower else branch in set_lookkey and set_insert_clean. At least I didn't
find a regression in microbenchmarks, but found small benefit.
For example:
$ ./python -m timeit -s n =
Serhiy Storchaka added the comment:
s = set()
s.add(164)
s.add(264)
s.add(364)
list(s)
[36893488147419103232, 18446744073709551616, 55340232221128654848]
s.discard(164)
s.discard(264)
s.add(364)
list(s)
[55340232221128654848, 55340232221128654848]
--
Raymond Hettinger added the comment:
Thank Serhiy. No early-out on insertion is possible.
For discard and contains, there is still no need for
testing dummies and tracking freeslots.
--
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka added the comment:
Here are more ideas. I would probe to use set_lookkey_dummy_ignored() with
following set_find_free_slot() (from set_faster_copy_2.patch in issue23290) if
former hadn't find a key. If set hash == -1 for key == NULL, we can use only
one comparison for testing
New submission from Raymond Hettinger:
This patch applies three techniques to tighten-up the generated code for the
lookkey() for sets.
I'm not sure I want to do this because it expands the size of the code quite a
bit (much like the previously existing lookkey specializations did). As such,
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23359
___
___
Raymond Hettinger added the comment:
One further possible transformation is to inline set_lookkey_dummy_allowed()
inside set_insert_key() which is the only place it is used. That saves all the
test and branch code inside the latter (all that code does is reconstruct the
exit points for
18 matches
Mail list logo