On 1/15/07, Armin Rigo <arigo@...> wrote:
> Hi Dick,
>
> On Sun, Jan 14, 2007 at 04:51:29PM 0800, Dick Moores wrote:
> > for x in xrange(5000000):
> > ln(640320**3 + 744)/163**.5
>
> This loop must be put in a function if you want Psyco to optimize it.
> See the docs  this is documented in
> http://psyco.sourceforge.net/psycoguide/unsupported.html .
Thank you, Armin! I'd completely forgotten that.
This time my code was:
======================
import psyco, time
psyco.full()
from math import log as ln
def test():
for x in xrange(5000000):
ln(640320**3 + 744)/163**.5
timeStart = time.time()
test()
timeEnd = time.time()
print "Time was %.4g seconds" % (timeEnd  timeStart)
print "%.15f" % (ln(640320**3 + 744)/163**.5)
"""
with psyco 1.938, 2.078, 2.203
without 4.578, 4.61, 4.625
"""
===========================
So a nice speedup with psyco, 2X+.
Dick
