On 8/21/06, Dino Viehland <[EMAIL PROTECTED]> wrote: > I think our generator performance is about on-par w/ CPython, so I don't > believe this is the issue (we actually did improve this somewhat during the > middle of the beta cycle when we did our perf push). But this test case: > > import time > > loops = 10000000 > def foo(): > for i in range(loops): yield i > > x = time.clock(); y = foo() > def timeit(): > x = time.clock() > y = foo() > for i in range(loops): z = y.next() > end = time.clock() > print end - x > > timeit() > > takes about 8 seconds on my machine for both CPython & IronPython (CPython is > a little bit faster, but it's not very significant).
The time it takes here is probably dominated by the time it takes to allocate ~80mb of ram from two 10,000,000-length lists, if try the tests again with xrange instead of range and post your results. _______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
