generators : random shootout

Tim Peters tim.one at home.com
Fri Jan 11 17:40:56 EST 2002


[Mark McEahern]
>     # the generator method
>     $ gen2.py 1000000
>     81.465763603
>     11.446000 seconds.
>
>     # the "old" method
>     $ gen.py 1000000
>     81.465763603
>     6.610000 seconds.
>
> So the old method is faster.

Heh.  If you don't post gen.py and gen2.py, you realize nobody else has any
idea what you're measuring -- right?  Or how you're measuring it.  From the
output, looks like you're using time.clock() on a Linux box, but this kind
of forced telepathy wears thin fast <wink>.





More information about the Python-list mailing list