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 sir-sigurd
Recipients josh.r, rhettinger, serhiy.storchaka, sir-sigurd, vstinner
Date 2019-02-27.08:11:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551255113.27.0.307132931695.issue36030@roundup.psfhosted.org>
In-reply-to
Content
>> This optimization also can be used for BUILD_TUPLE opcode and in pickle module, if it's OK to add _PyTuple_StealFromArray() function :-)

> I would like to see a micro-benchmark showing that it's faster.

+-----------------+-----------------+-----------------------------+
| Benchmark       | build_tuple_ref | build_tuple_untracked       |
+=================+=================+=============================+
| (a, )           | 19.9 ns         | 19.4 ns: 1.03x faster (-3%) |
+-----------------+-----------------+-----------------------------+
| (a, 1)          | 24.0 ns         | 22.6 ns: 1.06x faster (-6%) |
+-----------------+-----------------+-----------------------------+
| (a, 1, 1)       | 28.2 ns         | 25.9 ns: 1.09x faster (-8%) |
+-----------------+-----------------+-----------------------------+
| (a, 1, 1, 1)    | 31.0 ns         | 29.0 ns: 1.07x faster (-6%) |
+-----------------+-----------------+-----------------------------+
| (a, 1, 1, 1, 1) | 34.7 ns         | 32.2 ns: 1.08x faster (-7%) |
+-----------------+-----------------+-----------------------------+
History
Date User Action Args
2019-02-27 08:11:53sir-sigurdsetrecipients: + sir-sigurd, rhettinger, vstinner, serhiy.storchaka, josh.r
2019-02-27 08:11:53sir-sigurdsetmessageid: <1551255113.27.0.307132931695.issue36030@roundup.psfhosted.org>
2019-02-27 08:11:53sir-sigurdlinkissue36030 messages
2019-02-27 08:11:53sir-sigurdcreate