[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

STINNER Victor report at bugs.python.org
Tue Oct 18 13:03:58 EDT 2016


STINNER Victor added the comment:

Serhiy Storchaka:
> This is a senseless example. 0.0339 usec is not a time of executing "pass", it is an overhead of the iteration. You can't use timeit for measuring the performance of the code that takes such small time. You just can't get the reliable result for it. Even for code that takes an order larger time the result is not very reliable. Thus no need to worry about timing much less than 1 usec.

I will not argue about the reliability of the timeit module.

It's common to see code snippets using timeit for short
microbenchmarks taking less than 1 us, especially on
micro-optimization on CPython.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28240>
_______________________________________


More information about the Python-bugs-list mailing list