This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Speed-up deque.__contains__
Type: performance Stage: patch review
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: pitrou, python-dev, rhettinger, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-03-19 07:25 by rhettinger, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
deque_contains0.diff rhettinger, 2015-03-19 07:25 Improve speed of a __contains__ test review
deque_contains_timings.txt rhettinger, 2015-03-19 07:25 Comparative timings
Messages (5)
msg238496 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2015-03-19 07:25
Help deques match the performance of lists for a __contains__ check.  Comparative timings are attached.
msg238709 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-03-20 18:39
Except one line with dubious spacing the patch LGTM.
msg238717 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2015-03-20 20:10
It would be nice to add a test for the RuntimeError case.
msg238737 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-03-20 23:39
New changeset 99eb196fb345 by Raymond Hettinger in branch 'default':
Issue 23705:  Improve the performance of __contains__ checks for deques.
https://hg.python.org/cpython/rev/99eb196fb345
msg238738 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2015-03-20 23:39
Thanks guys.
History
Date User Action Args
2022-04-11 14:58:14adminsetgithub: 67893
2015-03-20 23:39:51rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg238738
2015-03-20 23:39:18python-devsetnosy: + python-dev
messages: + msg238737
2015-03-20 20:10:47pitrousetnosy: + pitrou
messages: + msg238717
2015-03-20 18:39:15serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg238709
2015-03-19 07:25:42rhettingersetfiles: + deque_contains_timings.txt
2015-03-19 07:25:15rhettingercreate