[Python-Dev] 3.3 str timings

Antoine Pitrou solipsis at pitrou.net
Tue Aug 21 17:53:15 CEST 2012


On 2012年8月21日 17:20:14 +0200
Andrea Griffini <agriff at tin.it> wrote:
> > 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.

For the record, under Linux, the following command:
$ sudo cpufreq-set -rg performance
should do the trick.
Regards
Antoine.
-- 
Software development and contracting: http://pro.pitrou.net


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /