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 Robert Haschke
Recipients Robert Haschke, benjamin.peterson, berker.peksag, guihome, serhiy.storchaka
Date 2016-06-18.15:21:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1466263306.05.0.103158284876.issue24424@psf.upfronthosting.co.za>
In-reply-to
Content
Thank you very much for further improving the code. As I understand it, the trick is to use temporary variables to minimize access time. Learned something new.

I adapted your patch to python 2.7 again. Now, in python3, the new code is even faster than the old one (sometimes) for front insertions:

36 time for 10000 insertions at front: 0.117563
opt36 time for 10000 insertions at front: 0.116014

36 time for 10000 insertions at front: 0.114282
opt36 time for 10000 insertions at front: 0.116710

old time for 5000 insertions at front: 0.044055
new time for 5000 insertions at front: 0.075433
opt27 time for 5000 insertions at front: 0.052135

old time for 5000 insertions at back: 15.241450
new time for 5000 insertions at back: 0.071004
opt27 time for 5000 insertions at back: 0.046850

I hope you can consider, the patch for python 2.7. There the performance gain is most significant.
History
Date User Action Args
2016-06-18 15:21:46Robert Haschkesetrecipients: + Robert Haschke, benjamin.peterson, berker.peksag, serhiy.storchaka, guihome
2016-06-18 15:21:46Robert Haschkesetmessageid: <1466263306.05.0.103158284876.issue24424@psf.upfronthosting.co.za>
2016-06-18 15:21:46Robert Haschkelinkissue24424 messages
2016-06-18 15:21:45Robert Haschkecreate