Help me choose a C++ compiler to work with Python

rhmd rh4170056 at juno.com
Wed Oct 1 05:21:54 EDT 2003


There was an error in my previous message Wichmann Hill has a period
of less than 10**14 (not 10**10)

rh4170056 at juno.com (rhmd) wrote in message news:<616fccba.0309280207.394ff56d at posting.google.com>...
> Alex Martelli <aleax at aleax.it> wrote in message news:<yFBcb.119348$hE5.4103433 at news1.tin.it>...
> > 
> > Similar orders of magnitude for the built-in random number generator,
> > which IS a Mersenne Twister in Python 2.3 -- at least on my old trusty
> > Athlon box (no doubt today's CPU's would easily take 3 or 4 times less):
> > 
> > [alex at lancelot python2.3]$ python timeit.py \
> > > -s "from random import random"  \
> > > -s "times=[None]*1000" 
> > > "for x in times: random()"
> > 1000 loops, best of 3: 380 usec per loop
> > 
> > 380 microseconds for 1,000 calls to random.random(), and here, too,
> > very linear scaling, suggests about 380 seconds for a billion calls,
> > i.e., about 6 or 7 minutes, on this old machine.
> 
> Wow!  I didn't realize that 2.3 had upgraded to Mersenne Twister
> (which has a period of more than 10**10000, vs. WichmannHill which has
> a period of less than 10**10 and the Excel 2000 PNRG which (to my
> shock and chagrin) had a period of about 10**7).  This is awesome.




More information about the Python-list mailing list