Message352133
$ ./python -m pyperf timeit --compare-to ./python-master 'dict()'
python-master: ..................... 89.9 ns +- 1.2 ns
python: ..................... 72.5 ns +- 1.6 ns
Mean +- std dev: [python-master] 89.9 ns +- 1.2 ns -> [python] 72.5 ns +- 1.6 ns: 1.24x faster (-19%)
$ ./python -m pyperf timeit --compare-to ./python-master -s 'import string; a=dict.fromkeys(string.ascii_lowercase); b=dict.fromkeys(string.ascii_uppercase)' -- 'dict(a, **b)'
python-master: ..................... 1.41 us +- 0.04 us
python: ..................... 1.53 us +- 0.04 us
Mean +- std dev: [python-master] 1.41 us +- 0.04 us -> [python] 1.53 us +- 0.04 us: 1.09x slower (+9%)
---
There is some overhead in old dict merging idiom. But it seems reasonable compared to the benefit. LGTM. |
|
Date |
User |
Action |
Args |
2019-09-12 11:48:13 | methane | set | recipients:
+ methane, Mark.Shannon, jdemeyer, miss-islington |
2019-09-12 11:48:13 | methane | set | messageid: <1568288893.26.0.441205689079.issue37207@roundup.psfhosted.org> |
2019-09-12 11:48:13 | methane | link | issue37207 messages |
2019-09-12 11:48:13 | methane | create | |
|