Message382365
Some quick benchmarks on a normal build with CPU isolation, tuned with pyperf. No PGO/LTO.
$ ./python -m pyperf timeit --rigorous --setup 'i = (None,) * 10_000_000' 'for _, _ in zip(i, i): pass' # Current master.
.........................................
Mean +- std dev: 279 ms +- 11 ms
$ ./python -m pyperf timeit --rigorous --setup 'i = (None,) * 10_000_000' 'for _, _ in zip(i, i): pass' # With above fix.
.........................................
Mean +- std dev: 369 ms +- 20 ms
$ ./python -m pyperf timeit --rigorous --setup 'i = (None,) * 10_000_000' 'for _, _ in zip(i, i): pass' # With above fix (no _PyTuple_MaybeUntrack).
.........................................
Mean +- std dev: 284 ms +- 17 ms
$ ./python -m pyperf timeit --rigorous --setup 'i = (None,) * 10_000_000' 'for _, _ in zip(i, i): pass' # With no tuple reuse.
.........................................
Mean +- std dev: 526 ms +- 51 ms
Note that this example reuses the result tuple for *every* iteration. |
|
| Date |
User |
Action |
Args |
| 2020-12-03 02:02:03 | brandtbucher | set | recipients:
+ brandtbucher, rhettinger, vstinner, serhiy.storchaka |
| 2020-12-03 02:02:03 | brandtbucher | set | messageid: <1606960923.31.0.257464955997.issue42536@roundup.psfhosted.org> |
| 2020-12-03 02:02:03 | brandtbucher | link | issue42536 messages |
| 2020-12-03 02:02:03 | brandtbucher | create | |
|