[issue12422] When deepcopying, don't store immutable objects in the memo dict

2011-06-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset e24ad85e9608 by Benjamin Peterson in branch 'default': don't memoize objects that are their own copies (closes #12422) http://hg.python.org/cpython/rev/e24ad85e9608 -- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected st

[issue12422] When deepcopying, don't store immutable objects in the memo dict

2011-06-27 Thread Alex Gaynor
Alex Gaynor added the comment: Amaury points out: this is not strictly about immutable objects, but rather objects who's deepcopy is themselves (identity-wise), in some (rare I think) cases this could provide a slowdown. Specifically a case of [(1, 2, 3)] * 1 would be slower, because it

[issue12422] When deepcopying, don't store immutable objects in the memo dict

2011-06-27 Thread Alex Gaynor
Alex Gaynor added the comment: Switched to using assertIs, as merwok suggested. -- Added file: http://bugs.python.org/file22500/d.diff ___ Python tracker ___ ___

[issue12422] When deepcopying, don't store immutable objects in the memo dict

2011-06-27 Thread Alex Gaynor
Alex Gaynor added the comment: A slightly cleverer version (or less clever, depending on how you approach the issue) that also works with tuples of immutable content. -- Added file: http://bugs.python.org/file22499/d.diff ___ Python tracker

[issue12422] When deepcopying, don't store immutable objects in the memo dict

2011-06-27 Thread Carl Friedrich Bolz
Changes by Carl Friedrich Bolz : -- nosy: +Carl.Friedrich.Bolz ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12422] When deepcopying, don't store immutable objects in the memo dict

2011-06-27 Thread Alex Gaynor
New submission from Alex Gaynor : All storing immutable objects in the memo dict does is slow stuff down, due to having a larger hash table, and on some other Python's causing hilarious levels of GC pressure. Using http://paste.pocoo.org/show/421310/ as a benchmark, CPython get's a 2x speedup