[Python-Dev] 3.3 str timings (original) (raw)

Andrea Griffini agriff at tin.it
Tue Aug 21 17:20:14 CEST 2012


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.



More information about the Python-Dev mailing list