Repository navigation
C implementation of parts of copy.deepcopy #72793
Description
Activity
This is mostly an RFC patch. It compiles and passes the test suite. A somewhat silly microbenchmark such as
./python -m timeit -s 'import copy; x = dict([(str(x), x) for x in range(10000)]);' 'copy.deepcopy(x)'
runs about 30x faster. In the (2.7 only) application which motivated this, the part of its initialization that does a lot of deepcopying drops from 11s to 3s. That it's so much less is presumably because the application holds on to the deepcopies, so there's much more allocation going on than in the microbenchmark, but I haven't investigated thoroughly. In any case, a 3.5x speedup is also nice.
- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory3.7 (EOL)end of lifeend of lifeperformancePerformance or resource usagePerformance or resource usage
on Nov 3, 2016 - addedextension-modulesC modules in the Modules dirC modules in the Modules dirand removedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Nov 3, 2016 New version, addressing (hopefully) all review comments.
Hy Rasmus,
would you like to make a PR with your patch and adding some tests?
Thanks!
@pablogsal The issue has been stale for a long time, but I created a PR and provided benchmarks.
The functionality of
deepcopyhas not changed, so I am not sure whether more tests are required. If so, can you let me know which specific tests you had in mind?- added3.12only security fixesonly security fixesand removed3.7 (EOL)end of lifeend of life
on Sep 9, 2022
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: