Re: [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered

2016年9月15日 02:00:08 -0700

2016年09月15日 10:02 GMT+02:00 INADA Naoki <[email protected]>:
> In my environ:
>
> ~/local/python-master/bin/python3 -m timeit -s "d =
> dict.fromkeys(range(10**6))" 'list(d)'
Stooooop! Please stop using timeit, it's lying!
* You must not use the minimum but average or median
* You must run a microbenchmark in multiple processes to test
different randomized hash functions and different memory layouts
In short: you should use my perf module.
http://perf.readthedocs.io/en/latest/cli.html#timeit
The memory layout and the hash function have a major important on such
microbenchmark:
https://haypo.github.io/journey-to-stable-benchmark-average.html
> Both Python is built without neither `--with-optimizations` or `make
> profile-opt`.
That's bad :-) For most reliable benchmarks, it's better to use
LTO+PGO compilation.
Victor
_______________________________________________
Python-Dev mailing list
[email protected]
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