Message402313
Old, with PGO:
$ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 10000))' 'sum(d)'
1000 loops, best of 5: 340 usec per loop
$ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 10000))' 'sum(d)'
2000 loops, best of 5: 114 usec per loop
$ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 10000))' 'sum(d)'
5000 loops, best of 5: 73.4 usec per loop
$ ./python -m timeit -s 'd = list(range(10000))' 'sum(d)'
5000 loops, best of 5: 73.3 usec per loop
$ ./python -m timeit -s 'd = [0] * 10000' 'sum(d)'
5000 loops, best of 5: 78.7 usec per loop
New, with PGO:
$ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 10000))' 'sum(d)'
1000 loops, best of 5: 305 usec per loop
$ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 10000))' 'sum(d)'
2000 loops, best of 5: 115 usec per loop
$ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 10000))' 'sum(d)'
5000 loops, best of 5: 52.4 usec per loop
$ ./python -m timeit -s 'd = list(range(10000))' 'sum(d)'
5000 loops, best of 5: 54 usec per loop
$ ./python -m timeit -s 'd = [0] * 10000' 'sum(d)'
5000 loops, best of 5: 45.8 usec per loop
The results are a bit more mixed with PGO optimisation (I tried a couple of times), not sure why. Might just be normal fluctuation, bad benchmark value selection, or accidental PGO tuning, can't say. In any case, the 1-digit case (10000, 2**29) is again about 28% faster and none of the other cases seems (visibly) slower.
I think this is a very clear net-win. |
|
Date |
User |
Action |
Args |
2021-09-21 11:21:49 | scoder | set | recipients:
+ scoder, gvanrossum, rhettinger, mark.dickinson, steven.daprano, lukasz.langa, serhiy.storchaka |
2021-09-21 11:21:49 | scoder | set | messageid: <1632223309.34.0.625426294169.issue24076@roundup.psfhosted.org> |
2021-09-21 11:21:49 | scoder | link | issue24076 messages |
2021-09-21 11:21:49 | scoder | create | |
|