On 15.09.16 11:57, Victor Stinner wrote:
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

$ ./python -m perf timeit -s "d = dict.fromkeys(range(10**6))" -- "list(d)"

Python 3.5: Median +- std dev: 65.1 ms +- 4.9 ms
Python 3.6: Median +- std dev: 79.4 ms +- 3.9 ms

Other computer:
Python 3.5: Median +- std dev: 33.6 ms +- 0.3 ms
Python 3.6: Median +- std dev: 37.5 ms +- 0.2 ms


_______________________________________________
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