Issue 28607: C implementation of parts of copy.deepcopy
Issue28607
Created on 2016-11-03 23:11 by villemoes, last changed 2022-04-11 14:58 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| deepcopy.patch | villemoes, 2016-11-03 23:11 | review | ||
| deepcopy.patch | villemoes, 2016-11-08 23:12 | patch v2 | review | |
| Messages (3) | |||
|---|---|---|---|
| msg280032 - (view) | Author: Rasmus Villemoes (villemoes) | Date: 2016-11-03 23:11 | |
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. |
|||
| msg280360 - (view) | Author: Rasmus Villemoes (villemoes) | Date: 2016-11-08 23:12 | |
New version, addressing (hopefully) all review comments. |
|||
| msg334105 - (view) | Author: Pablo Galindo Salgado (pablogsal) * ![]() |
Date: 2019-01-20 21:43 | |
Hy Rasmus, would you like to make a PR with your patch and adding some tests? Thanks! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:39 | admin | set | github: 72793 |
| 2019-01-20 21:43:41 | pablogsal | set | nosy:
+ pablogsal messages: + msg334105 |
| 2016-11-08 23:12:38 | villemoes | set | files:
+ deepcopy.patch messages: + msg280360 |
| 2016-11-03 23:13:58 | brett.cannon | set | components:
+ Extension Modules, - Library (Lib) stage: test needed |
| 2016-11-03 23:11:36 | villemoes | create | |
