> My benchmark.py script calibrates automatically the number of loops to > take at least 100 ms, and then repeat the test during at least 1.0 > second. > > Using time instead of a fixed number of loops is more reliable because > the test is less dependent on the system activity.
I've also been bitten in the past by something that is probably quite obvious but I didn't think to, that is dynamic cpu frequency. Many modern CPUs can dynamically change the frequency depending on the load and temperature and the switch can take more than one second. When doing benchmarks now I've a small script (based on cpufreq-set) that just blocks all the cores into fast mode. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com