2016-09-15 10:02 GMT+02:00 INADA Naoki <songofaca...@gmail.com>: > 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 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