Message337442
| Author | brandtbucher |
|---|---|
| Recipients | brandtbucher |
| Date | 2019-03-07.21:39:51 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1551994791.27.0.137413280424.issue36229@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
Binary operations on collections are, in general, of quadratic complexity. However, we can sometimes operate in-place if we know that we hold the only reference to the object. This allows us to avoid making many intermediate copies when summing many lists (or dicts ;), taking the union of many sets, or working with literals. The attached PR adds a simple 2-line refcount check which delegates to the corresponding in-place operation for: list_concat, list_repeat, set_and, set_or, set_xor, set_sub, bytearray_concat, and bytearray_repeat. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-03-07 21:39:51 | brandtbucher | set | recipients: + brandtbucher |
| 2019-03-07 21:39:51 | brandtbucher | set | messageid: <1551994791.27.0.137413280424.issue36229@roundup.psfhosted.org> |
| 2019-03-07 21:39:51 | brandtbucher | link | issue36229 messages |
| 2019-03-07 21:39:51 | brandtbucher | create | |