can multi-core improve single funciton?

Gerhard Weis gweis at gmx.at
Tue Feb 10 17:31:46 EST 2009


On 2009-02-11 08:01:29 +1000, Steven D'Aprano 
<steven at REMOVE.THIS.cybersource.com.au> said:

> On Tue, 10 Feb 2009 22:41:25 +1000, Gerhard Weis wrote:
> 
>> btw. the timeings are not that different for the naive recursion in OP's
>> version and yours.
>> fib(500) on my machine:
>> 	OP's: 0.00116 (far away from millions of years)
>> This here: 0.000583
> 
> I don't believe those timings are credible. On my machine, it took a
> minute to calculate fib(38), and while my machine isn't exactly the
> fastest box possible, nor is it especially slow.
> 
> I don't wish to imply that you are deliberately lying, but your result of
> 0.00116 seconds for the naive version of fib(500) is so unrealistic in my
> experience that I believe you must be confused. Perhaps you've timed a
> less naive fib() but thought it was the naive version.
> 
> Unless somebody can point out an error in my analysis, I'm sticking to my
> earlier claim that the naive version of fib(500) requires an unbelievably
> huge number of function calls: significantly more than the value of fib
> (500) itself. See my earlier post in this thread for details.

I am sorry for the wrong timing, I mixed up the function names. The 
naive version used partly your version and partly the naive recursion. 
So less naive is a good description :)

after fixing it:
naive fib(38): ~40seconds




More information about the Python-list mailing list