[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-03-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Then go ahead with the patch as is. -- ___ Python tracker ___ ___

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > This looks nicer and should run faster by taking advantage of the LIST_APPEND > opcode. The difference is insignificantly (less than 1%) for large lists (list(range(1))), but it is 3-4% slower for small lists (list(range(10))) and 20-25% slower for

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: One suggestion: def _deepcopy_list(x, memo, deepcopy=deepcopy): y = [] memo[id(x)] = y y[:] = [deepcopy(a, memo) for a in x] return y This looks nicer and should run faster by taking advantage of the LIST_APPEND opcode.

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If there are no other comments, I'm going to commit the patch in short time. -- ___ Python tracker ___

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-01-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry. Here is a patch. -- keywords: +patch Added file: http://bugs.python.org/file41679/copy_speedup.patch ___ Python tracker

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-01-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: Good point. Though I don't see any attached patches... -- ___ Python tracker ___

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-01-20 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- title: Improve copy.copy speed for built-in types -> Improve copy.copy speed for built-in types (list/set/dict) ___ Python tracker

[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: methodcaller is not needed. We can use just list.copy etc. Proposed patch speeds up copying list, dict, set, bytearray, slice, NotImplemented. It makes deepcopying list, tuple, dict a little faster. It makes the code for copying and deepcopying using