Message336735
>> 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%) |
+-----------------+-----------------+-----------------------------+ |
|
Date |
User |
Action |
Args |
2019-02-27 08:11:53 | sir-sigurd | set | recipients:
+ sir-sigurd, rhettinger, vstinner, serhiy.storchaka, josh.r |
2019-02-27 08:11:53 | sir-sigurd | set | messageid: <1551255113.27.0.307132931695.issue36030@roundup.psfhosted.org> |
2019-02-27 08:11:53 | sir-sigurd | link | issue36030 messages |
2019-02-27 08:11:53 | sir-sigurd | create | |
|