Author xiang.zhang
Recipients inada.naoki, rhettinger, serhiy.storchaka, vstinner, xiang.zhang
Date 2016-10-29.06:14:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477721640.73.0.798391842129.issue28199@psf.upfronthosting.co.za>
In-reply-to
Content
If you inline insert_index, dictresize3 is not that bad.

./python3 -m perf timeit -s 'x = list(range(1000))' -- 'dict.fromkeys(x)'
dictresize3: Median +- std dev: 43.9 us +- 0.7 us
dictresize3(insert_index inlined): Median +- std dev: 41.6 us +- 0.6 us
dictresize4: Median +- std dev: 41.7 us +- 1.2 us

But don't bother on microbenchmark, just move on. I just think the logic is not as clear as dictresize3. But the easiness for future modification makes sense.
History
Date User Action Args
2016-10-29 06:14:00xiang.zhangsetrecipients: + xiang.zhang, rhettinger, vstinner, inada.naoki, serhiy.storchaka
2016-10-29 06:14:00xiang.zhangsetmessageid: <1477721640.73.0.798391842129.issue28199@psf.upfronthosting.co.za>
2016-10-29 06:14:00xiang.zhanglinkissue28199 messages
2016-10-29 06:14:00xiang.zhangcreate