Author serhiy.storchaka
Recipients inada.naoki, ned.deily, rhettinger, serhiy.storchaka, vstinner, xiang.zhang
Date 2016-09-17.18:21:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1474136502.91.0.316374678343.issue28183@psf.upfronthosting.co.za>
In-reply-to
Content
Good catch Xiang Zhang! I missed this point. Here is fixed patch.

$ ./python -m perf timeit -s "d = dict.fromkeys(range(10**6))" -- "list(d)"
Python 3.5:            Median +- std dev: 33.8 ms +- 0.7 ms
Python 3.6 unpatched:  Median +- std dev: 37.8 ms +- 0.5 ms
Python 3.6 patched:    Median +- std dev: 34.0 ms +- 0.6 ms

$ ./python -m perf timeit -s "d = dict.fromkeys(range(10**6)); v = d.values()" -- "list(v)"
Python 3.5:            Median +- std dev: 26.2 ms +- 0.7 ms
Python 3.6 unpatched:  Median +- std dev: 28.0 ms +- 0.6 ms
Python 3.6 patched:    Median +- std dev: 26.1 ms +- 0.8 ms

$ ./python -m perf timeit -s "d = dict.fromkeys(range(10**6)); v = d.items()" -- "list(v)"
Python 3.5:            Median +- std dev: 232 ms +- 6 ms
Python 3.6 unpatched:  Median +- std dev: 259 ms +- 6 ms
Python 3.6 patched:    Median +- std dev: 249 ms +- 6 ms

$ ./python -m perf timeit -s "d = dict.fromkeys(range(10**6))" -- "set(d)"
Python 3.5:            Median +- std dev: 68.3 ms +- 1.8 ms
Python 3.6 unpatched:  Median +- std dev: 68.1 ms +- 2.5 ms
Python 3.6 patched:    Median +- std dev: 63.7 ms +- 1.5 ms

$ ./python -m perf timeit -s "from _testcapi import test_dict_iteration as t" -- "t()"
Python 3.5:            Median +- std dev: 3.31 ms +- 0.10 ms
Python 3.6 unpatched:  Median +- std dev: 3.51 ms +- 0.09 ms
Python 3.6 patched:    Median +- std dev: 3.43 ms +- 0.05 ms
History
Date User Action Args
2016-09-17 18:21:42serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, vstinner, ned.deily, inada.naoki, xiang.zhang
2016-09-17 18:21:42serhiy.storchakasetmessageid: <1474136502.91.0.316374678343.issue28183@psf.upfronthosting.co.za>
2016-09-17 18:21:42serhiy.storchakalinkissue28183 messages
2016-09-17 18:21:42serhiy.storchakacreate