Author inada.naoki
Recipients inada.naoki
Date 2020-07-29.02:05:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1595988335.29.0.124634508156.issue41431@roundup.psfhosted.org>
In-reply-to
Content
To reduce code size, I am considering to remove clone_combined_dict. I will check how PyDict_Copy() is performance critical.

This is microbenchmark result of d.copy() and dict(d).

$ ./python -m pyperf timeit --compare-to ./python-master -s 'd=dict.fromkeys(range(1000))' -- 'd.copy()'
python-master: ..................... 4.36 us +- 0.07 us
python: ..................... 5.96 us +- 0.10 us

Mean +- std dev: [python-master] 4.36 us +- 0.07 us -> [python] 5.96 us +- 0.10 us: 1.37x slower (+37%)

$ ./python -m pyperf timeit --compare-to ./python-master -s 'd=dict.fromkeys(range(1000))' -- 'dict(d)'
python-master: ..................... 21.6 us +- 0.2 us
python: ..................... 6.01 us +- 0.09 us

Mean +- std dev: [python-master] 21.6 us +- 0.2 us -> [python] 6.01 us +- 0.09 us: 3.59x faster (-72%)
History
Date User Action Args
2020-07-29 02:05:35inada.naokisetrecipients: + inada.naoki
2020-07-29 02:05:35inada.naokisetmessageid: <1595988335.29.0.124634508156.issue41431@roundup.psfhosted.org>
2020-07-29 02:05:35inada.naokilinkissue41431 messages
2020-07-29 02:05:34inada.naokicreate