can multi-core improve single funciton?

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Tue Feb 10 17:01:29 EST 2009


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.



-- 
Steven



More information about the Python-list mailing list