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 serhiy.storchaka
Recipients brandtbucher, pablogsal, serhiy.storchaka
Date 2019-10-11.18:43:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570819424.93.0.770331724126.issue38436@roundup.psfhosted.org>
In-reply-to
Content
> I do not see any significant change in + operator timing on my machine (again, just a rough test):

Because the time includes the time of iterating, which can be significant in comparison with adding two integers. Please use the pyperf module with --duplicate=1000.

> I'm aware that unpacking is "better". With that said, adding a list literal (or a slice of any list, or a list comprehension) to another list is a fairly common operation (I count several dozen examples in the stdlib).

Could you provide any numbers? For example you can patch ceval.c to count these BINARY_ADD for which your optimization works and these for which it does not work and output counts at the exit of Python. Run several Python programs with the modified interpreter. Tests are bad example, but better than nothing. Something like hg would be better. You are free to find programs that would benefit the most from your optimization.

> And the speed-up is good, even in these cases.

5%. It is not impressive for optimizing a single rare operation.
History
Date User Action Args
2019-10-11 18:43:44serhiy.storchakasetrecipients: + serhiy.storchaka, pablogsal, brandtbucher
2019-10-11 18:43:44serhiy.storchakasetmessageid: <1570819424.93.0.770331724126.issue38436@roundup.psfhosted.org>
2019-10-11 18:43:44serhiy.storchakalinkissue38436 messages
2019-10-11 18:43:44serhiy.storchakacreate