[issue32039] timeit documentation should describe caveats

Barry A. Warsaw report at bugs.python.org
Wed Nov 15 14:43:16 EST 2017


New submission from Barry A. Warsaw <barry at python.org>:

timeit is cool, but it's not appropriate for all performance testing.  For example, since it uses only a single Python process, anything that's cached is not a good candidate for timeit profiling.  The classic example is timing imports.  E.g. these are not the stats you're looking for:

$ python3 -mtimeit "import my.slow.module"

The timeit documentation should describe this caveat (are there others?) and possibly point to both cProfile and the 3rd party perf package as alternative ways to gather performance information.

----------
assignee: barry
components: Documentation
messages: 306303
nosy: barry
priority: normal
severity: normal
status: open
title: timeit documentation should describe caveats
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32039>
_______________________________________


More information about the Python-bugs-list mailing list