[SciPy-user] Anybody used weave.blitz to speed NumPy up?

Travis Oliphant oliphant at ee.byu.edu
Wed Jun 28 20:26:47 CDT 2006


Hello.

I've been playing around with weave and NumPy.  I have not been able to 
get weave.blitz to speed up any expression.  Has anybody had success at 
doing this with new NumPy.

Did something change to make blitz run more slowly?  

Try this test:

a = ones((512,512), float64)
b = ones((512,512), float64)

expr = "a[1:-1,1:-1] =  (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]" \
                           "+ b[1:-1,2:] + b[1:-1,:-2]) / 5."

weave.blitz(expr)

start = time.time(); exec(expr); stop = time.time(); print stop-start, 
"secs."
start = time.time(); weave.blitz(expr); stop = time.time(); print 
stop-start, "secs."

On the two systems I've tried the first is about 50% faster than the 
second.





More information about the SciPy-user mailing list