Message268815
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. |
|
Date |
User |
Action |
Args |
2016-06-18 15:21:46 | Robert Haschke | set | recipients:
+ Robert Haschke, benjamin.peterson, berker.peksag, serhiy.storchaka, guihome |
2016-06-18 15:21:46 | Robert Haschke | set | messageid: <1466263306.05.0.103158284876.issue24424@psf.upfronthosting.co.za> |
2016-06-18 15:21:46 | Robert Haschke | link | issue24424 messages |
2016-06-18 15:21:45 | Robert Haschke | create | |
|