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 <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1045>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to