This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Steve Howell
Recipients Rhamphoryncus, Steve Howell, flox, rhettinger, stutzbach
Date 2010-01-29.19:31:02
SpamBayes Score 1.583438e-07
Marked as misclassified No
Message-id <1264793464.81.0.653909820286.issue7784@psf.upfronthosting.co.za>
In-reply-to
Content
I am closing this due to mostly unanimous rejection on python-dev.

If folks reopen this in the future, the last patch that I submitted has been reasonably well tested, but it has not been code reviewed.

The 1% speed penalty could probably be driven down without too much effort, but not totally eliminated.

The constraint not to add a member to PyListObject complicates the code considerably.

In diving deep into listobject.c, I noticed a couple things unrelated to my patch:

  1) There might be a refactoring available for calls to list_resize, where callers just pass in the delta, instead of the new list size.  Lots of the callers do addition that could be pushed into list_resize.  Not sure it would lead to speed ups, but it would probably reduce code size.

  2) The optimistic realloc scheme is probably needlessly wasteful for really large lists.  If you have a million elements, I am not sure you need to allocate 12% extra space, and I think that's what the current algorithm does (untested).

  3) There might be some merit in splitting out list_resize into list_resize_bigger and list_resize_smaller.  I think the callers generally know when they are shrinking/expanding the list, so callers that are shrinking the list could call a leaner method that just shrinks the list without having to execute other instructions.
History
Date User Action Args
2010-01-29 19:31:05Steve Howellsetrecipients: + Steve Howell, rhettinger, Rhamphoryncus, stutzbach, flox
2010-01-29 19:31:04Steve Howellsetmessageid: <1264793464.81.0.653909820286.issue7784@psf.upfronthosting.co.za>
2010-01-29 19:31:03Steve Howelllinkissue7784 messages
2010-01-29 19:31:02Steve Howellcreate