Message 278914 - Python tracker

Message278914

Author vstinner
Recipients brett.cannon, lemburg, ned.deily, pitrou, python-dev, rhettinger, serhiy.storchaka, steven.daprano, tim.peters, vstinner
Date 2016-10-18.17:03:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMpsgwbUAWhOOt9b+yE=Cj4VVcZOWT6C-_yWf5r38K-8YYCaxw@mail.gmail.com>
In-reply-to <1476810036.87.0.381329462598.issue28240@psf.upfronthosting.co.za>
Content
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.
History
Date User Action Args
2016-10-18 17:03:58vstinnersetrecipients: + vstinner, lemburg, tim.peters, brett.cannon, rhettinger, pitrou, ned.deily, steven.daprano, python-dev, serhiy.storchaka
2016-10-18 17:03:58vstinnerlinkissue28240 messages
2016-10-18 17:03:58vstinnercreate