[SciPy-user] Performance Python with Weave article updated

Bob.Cowdery at CGI-Europe.com Bob.Cowdery at CGI-Europe.com
Fri Sep 24 08:23:39 CDT 2004


Ok I see the error of my ways, I should have read the article more closely!!
I need to expose each array using ArrayType - I guess that will make all the
difference to the Pyrex time...

Bob

========================================

-----Original Message-----
From: Cowdery, Bob [UK] 
Sent: 24 September 2004 10:05
To: 'SciPy Users List'
Subject: RE: [SciPy-user] Performance Python with Weave article updated


Thanks for a very interesting article. I have been trying to work out the
best way to optimise some signal processing code. I am experimenting on just
one function which is a demodulator and has nested loops that I don't think
can be optimised out with numeric - the result, it runs very slowly in
python. The attached code (yes I know it's a bit of a mess but its just for
testing) has the function as plain python, using weave and using pyrex.
Initially I thought the results were bogus because of the massive
differences but I can't see any errors in my code that would account for the
differences. The code does manipulate and use a lot of numeric arrays. Pyrex
is only about twice as fast and Weave a staggering 200+ times faster. I
would really prefer to use Pyrex as I want to precompile but would prefer
not to have a separate C compilation linked to Pyrex, which is the
combination I have not tried yet. Logic would tell me that that mode should
be the same as Weave except any differences in the extension code generated.

Here are the results (time in ms):

import test
test.pythontest()
762.090153916
test.pyrextest()
315.408801957
test.inlinetest()
file changed
5260.41745529
test.inlinetest()
3.00652736591

Regards
Bob
_______________________________________________
SciPy-user mailing list
SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3539 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20040924/dbef80eb/attachment-0001.bin


More information about the SciPy-user mailing list