Message259491
Attaching a new patch -- rewritten to optimize -, *, +, -=, *= and +=. I also removed the optimization of [] operator -- that should be done in a separate patch and in a separate issue.
Some nano-benchmarks (best of 3):
python -m timeit "sum([x + x + 1 for x in range(100)])"
2.7: 7.71 3.5: 8.54 3.6: 7.33
python -m timeit "sum([x - x - 1 for x in range(100)])"
2.7: 7.81 3.5: 8.59 3.6: 7.57
python -m timeit "sum([x * x * 1 for x in range(100)])"
2.7: 9.28 3.5: 10.6 3.6: 9.44
Python 3.6 vs 3.5 (spectral_norm, rigorous run):
Min: 0.315917 -> 0.276785: 1.14x faster
Avg: 0.321006 -> 0.284909: 1.13x faster
Zach, thanks a lot for the research! I'm glad that unpack_sequence finally proved to be irrelevant. Could you please take a look at the updated patch? |
|
Date |
User |
Action |
Args |
2016-02-03 17:00:24 | yselivanov | set | recipients:
+ yselivanov, rhettinger, mark.dickinson, pitrou, vstinner, casevh, serhiy.storchaka, josh.r, zbyrne |
2016-02-03 17:00:24 | yselivanov | set | messageid: <1454518824.58.0.481862737212.issue21955@psf.upfronthosting.co.za> |
2016-02-03 17:00:24 | yselivanov | link | issue21955 messages |
2016-02-03 17:00:24 | yselivanov | create | |
|