Message 335901 - Python tracker

Message335901

Author sir-sigurd
Recipients sir-sigurd
Date 2019-02-19.08:35:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550565320.39.0.769773111251.issue36031@roundup.psfhosted.org>
In-reply-to
Content
There are several cases in CPython sources when PyList_AsTuple() is used with just created list and immediately after that this list is Py_DECREFed. This operation can be performed more effectively since refcount of items is not changed. For example it gives such speed-up for BUILD_TUPLE_UNPACK:

Before:
$ python -m perf timeit -s "l = [None]*10**6" "(*l,)"
.....................
Mean +- std dev: 8.75 ms +- 0.10 ms

After:
$ python -m perf timeit -s "l = [None]*10**6" "(*l,)"
.....................
Mean +- std dev: 5.41 ms +- 0.07 ms
History
Date User Action Args
2019-02-19 08:35:20sir-sigurdsetrecipients: + sir-sigurd
2019-02-19 08:35:20sir-sigurdsetmessageid: <1550565320.39.0.769773111251.issue36031@roundup.psfhosted.org>
2019-02-19 08:35:20sir-sigurdlinkissue36031 messages
2019-02-19 08:35:20sir-sigurdcreate