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 brandtbucher
Recipients brandtbucher, rhettinger, serhiy.storchaka, vstinner
Date 2020-12-03.02:02:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606960923.31.0.257464955997.issue42536@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-12-03 02:02:03brandtbuchersetrecipients: + brandtbucher, rhettinger, vstinner, serhiy.storchaka
2020-12-03 02:02:03brandtbuchersetmessageid: <1606960923.31.0.257464955997.issue42536@roundup.psfhosted.org>
2020-12-03 02:02:03brandtbucherlinkissue42536 messages
2020-12-03 02:02:03brandtbuchercreate