[issue32534] Speed-up list.insert

Serhiy Storchaka report at bugs.python.org
Thu Jan 11 09:59:24 EST 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

In your benchmarks the difference between thresholds is only 4%. It would be not worth to keep a special case for such small benefit.

But note that in your benchmarks you inserted in a list with the size up to 50000 elements. The value of the threshold affects only the first few insertions. Your need to test inserting in short lists. Recreate a list at every iteration.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32534>
_______________________________________


More information about the Python-bugs-list mailing list