[IronPython] [Simpy-users] RE: SimPy on IronPython timing test

Timothy Fitz TimothyFitz at gmail.com
Tue Aug 22 16:00:47 CEST 2006

On 8/21/06, Dino Viehland <dinov at exchange.microsoft.com> 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.

More information about the Ironpython-users mailing list