Message411982
Usually, when you benchmark a non-trivial piece of code, you need also to specify a setup code. If the benchmarked code is large enough to be read from a file, the setup code should be read from a file too.
The common practice is to write the benchmarked code as a function which can be imported and repeatedly executed.
$ python -m timeit -s 'from mybench import test' 'test()' |
|
Date |
User |
Action |
Args |
2022-01-28 09:19:19 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, CCLDArjun |
2022-01-28 09:19:19 | serhiy.storchaka | set | messageid: <1643361559.97.0.0922514301096.issue46500@roundup.psfhosted.org> |
2022-01-28 09:19:19 | serhiy.storchaka | link | issue46500 messages |
2022-01-28 09:19:19 | serhiy.storchaka | create | |
|