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 larry, sir-sigurd
Date 2019-08-13.16:37:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565714248.3.0.317246195617.issue37842@roundup.psfhosted.org>
In-reply-to
Content
Argument Clinic generates `{NULL, NULL}` initializer for Py_buffer variables. Such initializer zeroes all Py_buffer members, but as I understand only `obj` and `buf` members are really had to be initialized. Avoiding unneeded initialization provides tiny speed-up:

$ python -m perf timeit -s "replace = b''.replace" "replace(b'', b'')" --compare-to=../cpython-master/venv/bin/python --duplicate=1000
/home/sergey/tmp/cpython-master/venv/bin/python: ..................... 43.0 ns +- 0.5 ns
/home/sergey/tmp/cpython-dev/venv/bin/python: ..................... 41.8 ns +- 0.4 ns

Mean +- std dev: [/home/sergey/tmp/cpython-master/venv/bin/python] 43.0 ns +- 0.5 ns -> [/home/sergey/tmp/cpython-dev/venv/bin/python] 41.8 ns +- 0.4 ns: 1.03x faster (-3%)
History
Date User Action Args
2019-08-13 16:37:28sir-sigurdsetrecipients: + sir-sigurd, larry
2019-08-13 16:37:28sir-sigurdsetmessageid: <1565714248.3.0.317246195617.issue37842@roundup.psfhosted.org>
2019-08-13 16:37:28sir-sigurdlinkissue37842 messages
2019-08-13 16:37:28sir-sigurdcreate