[issue21988] Decrease iterating overhead in timeit

Antoine Pitrou report at bugs.python.org
Wed Jul 16 19:43:38 CEST 2014


Antoine Pitrou added the comment:

Le 16/07/2014 12:43, Steven D'Aprano a écrit :
>
> I would *much* rather a parameter to timeit which controls whether or
> not to unroll, rather than timeit trying to guess whether you want it to
> unroll or not. PyPy can default to off, CPython to on, and other
> implementations can choose whichever default makes sense for them.

I think it is overkill. Apart from rather silly microbenchmarks, there 
isn't much point in adding the loop unrolling facility. In real world, 
even cheap operations such as "x = x + 1" will be surrounded by less 
cheap operations, so if an improvement cannot yield tangible benefits 
inside a simple for loop, then it doesn't deserve to be committed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21988>
_______________________________________


More information about the Python-bugs-list mailing list