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 christian.heimes
Recipients alex, benjamin.peterson, brett.cannon, christian.heimes, pitrou, rhettinger, serhiy.storchaka
Date 2013-03-05.18:53:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362509615.11.0.898720848367.issue17338@psf.upfronthosting.co.za>
In-reply-to
Content
Here is an experimental patch. The speedup is ... measurable.

$ ./python -m timeit -n1000 "l = []" "l.__preallocate__(10000)" "app = l.append" "for i in range(10000): app(i)" "l.__shrink__()"
1000 loops, best of 3: 3.68 msec per loop

$ ./python -m timeit -n1000 "l = []" "app = l.append" "for i in range(10000): app(i)"
1000 loops, best of 3: 3.75 msec per loop
History
Date User Action Args
2013-03-05 18:53:35christian.heimessetrecipients: + christian.heimes, brett.cannon, rhettinger, pitrou, benjamin.peterson, alex, serhiy.storchaka
2013-03-05 18:53:35christian.heimessetmessageid: <1362509615.11.0.898720848367.issue17338@psf.upfronthosting.co.za>
2013-03-05 18:53:35christian.heimeslinkissue17338 messages
2013-03-05 18:53:34christian.heimescreate