Ron Adam <ron3...@gmail.com> added the comment:

A simple test to show the difference.

BEFORE:

$ python3 -mtimeit "def y(n):" "  for x in range(n):" "    yield  x" 
"sum(y(10))"
100000 loops, best of 3: 3.87 usec per loop
$ python3 -mtimeit "def y(n):" "  for x in range(n):" "    yield  x" 
"sum(y(1000000))"
10 loops, best of 3: 186 msec per loop

AFTER:
$ ./python -mtimeit "def y(n):" "  for x in range(n):" "    yield  x" 
"sum(y(10))"
100000 loops, best of 3: 3.81 usec per loop
$ ./python -mtimeit "def y(n):" "  for x in range(n):" "    yield  x" 
"sum(y(1000000))"
10 loops, best of 3: 168 msec per loop

                       before   after
y(10)         usec's   3.87    3.81     - 1.55%   
y(1000000)    msec's   186     168      - 9.67%

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13607>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to