New submission from Barry A. Warsaw <ba...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue32039>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to