Re: [Speed] Tool to run Python microbenchmarks

On Fri, Feb 12, 2016 at 4:58 PM, Victor Stinner victor.stinner@gmail.com wrote:
Hi,
2016-02-12 16:42 GMT+01:00 Maciej Fijalkowski fijall@gmail.com:
timeit does two really terrible things - uses min(time) and disables the garbage collector, which makes it completely unreliable.
Can you please elaborate why using min(times) is a bad idea?
I'm also using min() in my tool, I expect that it helps to ignore the sporadic peeks when the system is unstable.
Victor
Yes, it also helps to ignore systematic peaks that will happen randomly (due to cache alignment, memory ordering, dicts etc.). Some operations are really random that you should not ignore. E.g. if you have:
l.append('a') in a loop, you gonna ignore all the places that resize loop.
I'll look for a reference
participants (1)
-
Maciej Fijalkowski