[issue1045] Performance regression in 2.5

Amaury Forgeot d'Arc report at bugs.python.org
Tue Nov 27 19:04:18 CET 2007


Amaury Forgeot d'Arc added the comment:

The slowdown is due to the new function _PyObject_LengthHint: on my
Win2K machine, 
the command
  python -m timeit "tuple(1 for _ in xrange(3))"
answers:
  100000 loops, best of 3: 4.14 usec per loop
By adding a line "return rv;" on the second line of
_PyObject_LengthHint, I get:
  100000 loops, best of 3: 2.71 usec per loop

Should we disable this function for some known built-in types?

----------
nosy: +amaury.forgeotdarc

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1045>
__________________________________


More information about the Python-bugs-list mailing list