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: Enhance deepcopy-ing for tuples
Type: performance Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Claudiu.Popa, alexandre.vassalotti, python-dev, rhettinger
Priority: normal Keywords: patch

Created on 2014-02-16 21:46 by Claudiu.Popa, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
copy.patch Claudiu.Popa, 2014-02-16 21:46 review
Messages (4)
msg211362 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-02-16 21:46
Hello!

Here's a patch for improving the performance of tuple deepcopy-ing.

Without patch:

# ./python -m timeit -s "import copy; a=tuple(range(1000000))" -p "copy.deepcopy(a)"
10 loops, best of 3: 1.45 sec per loop

With patch:

# ./python -m timeit -s "import copy; a=tuple(range(1000000))" -p "copy.deepcopy(a)"
10 loops, best of 3: 1.32 sec per loop
msg217248 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-04-27 10:11
Ping? The change is clear, has the same semantics and its a little bit faster.
msg217850 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-04 00:22
New changeset 0df3004581fe by Benjamin Peterson in branch 'default':
improve idioms (closes #20642)
http://hg.python.org/cpython/rev/0df3004581fe
msg217851 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-05-04 00:38
This was a nice patch.
Thanks.
History
Date User Action Args
2022-04-11 14:57:58adminsetgithub: 64841
2014-05-04 00:38:47rhettingersetnosy: + rhettinger
messages: + msg217851
2014-05-04 00:22:40python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg217850

resolution: fixed
stage: resolved
2014-04-27 10:11:12Claudiu.Popasetmessages: + msg217248
2014-02-16 21:46:07Claudiu.Popacreate