[issue7784] patch for making list/insert at the top of the list avoid memmoves

showell report at bugs.python.org
Tue Jan 26 11:28:05 CET 2010


New submission from showell <showell30 at yahoo.com>:

I am attaching a patch to improve the performance of list operations that insert or delete elements at the front of the list.  The patch has had some discussion on python-dev in the thread entitled "patch to make list.pop(0) work in O(1) time."

So far the verdict is not to touch list internals to achieve this performance gain, but I am looking to improve the patch regardless and possibly include it in a PEP that documents the decision not to incorporate the patch, with the hope that it either prevents future duplication of effort or eventually gets accepted.

At a bare minimum, the patch needs extensive code review, as it touches a lot of internals, and it needs stylistic cleanup.  But it does pass all the tests, and it has been benchmarked to show 100X speed improvement on a small test case.

----------
components: Interpreter Core
files: DIFF
messages: 98324
nosy: Steve Howell
severity: normal
status: open
title: patch for making list/insert at the top of the list avoid memmoves
type: performance
versions: Python 3.2
Added file: http://bugs.python.org/file16008/DIFF

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7784>
_______________________________________


More information about the Python-bugs-list mailing list