[issue32534] Speed-up list.insert: use memmove()

STINNER Victor report at bugs.python.org
Wed Jan 17 10:39:41 EST 2018


STINNER Victor <victor.stinner at gmail.com> added the comment:

In https://gist.github.com/jeethu/dc0811d415dd6d1a1621761e43842f88 I read:

| django_template | 160 ms | 129 ms | 1.24x faster | Significant (t=15.05) |

So on this benchmark, the optimization seems significant. But in the same paste, I see other benchmarks 1.2x faster whereas they don't abuse list.insert(), and maybe don't use list.insert() at all.

Maybe Django template engine should be fixed to use deque instead ;-)

----------

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


More information about the Python-bugs-list mailing list