[SciPy-user] about weave performance evaluation

Dan Christensen jdc at uwo.ca
Wed Oct 26 10:45:31 CDT 2005

Pau Gargallo <pau.gargallo at gmail.com> writes:

>> This is discussed at the URL above.  Here's what they say:
>>   This is not a serious issue in this case because
>>   it is known that even when this happens the algorithm will converge
>>   (but in twice as much time, which reduces the benefit by a factor of
>>   2, which still leaves us with a 25 fold increase).
>> Dan
> i have then some [not important at all] questions (sorry again):
> as i understand from this text, the algorithm that the numeric code
> implements is intrinsically 2 times slower. Then,
> 1- i don't understand the 25 fold increase of the last sentence of the
> cited text. Shouldn't we conclude that the use of numeric speeds up by
> a factor 100?

I think 25 is correct.  When the numeric method gets err < eps, it
will be farther from the correct solution than when the pure python
method gets err < eps, since it is in effect taking smaller steps.
To get as accurate an answer, you'd have to adjust eps to make the
code run approximately twice as long.

I'm not at all an expert on this, but am just trying to rephrase
what is said at that URL.

On the other hand, as a comparison between pure python and numeric,
I think 50 is the right number.  Many problems won't have this
"factor of 2" issue, so with similar inner loops numeric should
give about a 50-fold increase in speed.

> 2- in the final comparison the time used by numeric is 29.3s. If we
> want to compare the performance between the different implementations,
> should we divide this time by 2 ?

Multiply, I think.


More information about the SciPy-user mailing list