# note: if you are running this demo interactively in PythonWin, you may need to # restart PythonWin to disable the psyco.full() call in primes2.py import time import primes # import psyco import psyco # create a compiled version of the method fastPrimes = psyco.proxy(primes.listPrimes) start = time.time() p = primes.listPrimes(50000) finish = time.time() slow = finish - start print 'no psyco: %.2f seconds' % slow start = time.time() p = fastPrimes(50000) finish = time.time() fast = finish - start print 'psyco: %.2f seconds' % fast print 'speedup: factor of %.2f' % (slow/fast)