Yury Selivanov added the comment:

>> PyDict_Copy creates a new empty dict object and then inserts key/values into 
>> it one by one.

> Why not creating a "preallocated" dict in that case? _PyDict_NewPresized()

I don't think it's related to the proposed patch.  Please take a look at the 
PR.  `_PyDict_NewPresized` and inserting entries one by one will not be faster 
than a `memcpy`.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31179>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to