Message349582
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%) |
|
Date |
User |
Action |
Args |
2019-08-13 16:37:28 | sir-sigurd | set | recipients:
+ sir-sigurd, larry |
2019-08-13 16:37:28 | sir-sigurd | set | messageid: <1565714248.3.0.317246195617.issue37842@roundup.psfhosted.org> |
2019-08-13 16:37:28 | sir-sigurd | link | issue37842 messages |
2019-08-13 16:37:28 | sir-sigurd | create | |
|