On 15 September 2016 at 07:31, Serhiy Storchaka <storch...@gmail.com> wrote:
> Note that this is made at the expense of the 20% slowing down an iteration.
>
> $ ./python -m timeit -s "d = dict.fromkeys(range(10**6))" -- "list(d)"
> Python 3.5: 66.1 msec per loop
> Python 3.6: 82.5 msec per loop

On my Windows 7 PC with 3.5.2 and 3.6.0b1 installed from the standard
python.org builds:

>py -3.5 -m timeit -s "d = dict.fromkeys(range(10**6))" -- "list(d)"
10 loops, best of 3: 21.7 msec per loop
>py -3.6 -m timeit -s "d = dict.fromkeys(range(10**6))" -- "list(d)"
100 loops, best of 3: 19.6 msec per loop

So 3.6 is faster for me.

Paul
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to