Language Shootout

Paul Winkler slinkp23 at yahoo.com
Mon Jul 9 23:12:59 EDT 2001


OK, I'll bite.
fibo.py is mine, ffib.py is yours.
Note that yours computes what is (according to mine and Frederik's scripts)
fibonacci of N-1 rather than fibonacci of N.

Other than that, you've kicked my butt!

Now is the time for me to strategically retreat and declare that what really
matters is readability. Who cares about speed? Not me! Never did, no sir. 

$ time ffib.py 1001 
fib( 1001 ) = 
70330367711422815821835254877183549770181269836358732742604905087154537118196933579742249494562611733487750449241765991088186363265450223647106012053374121273867339111198139373125598767690091902245245323403501

real    0m0.073s
user    0m0.060s
sys     0m0.010s

$ time fibo.py 1000
70330367711422815821835254877183549770181269836358732742604905087154537118196933579742249494562611733487750449241765991088186363265450223647106012053374121273867339111198139373125598767690091902245245323403501

real    0m0.080s
user    0m0.050s
sys     0m0.020s

$ time ffib.py 10001
real    0m0.154s
user    0m0.140s
sys     0m0.020s

$ time fibo.py 10000
real    0m0.384s
user    0m0.370s
sys     0m0.020s


$ time ffib.py 100001
real    0m6.598s
user    0m6.550s
sys     0m0.030s

$ time fibo.py 100000
real    0m24.433s
user    0m24.370s
sys     0m0.020s



-- 
...................    paul winkler   ....................
custom calendars & printing: http://www.calendargalaxy.com
       A member of ARMS:   http://www.reacharms.com
            home page:  http://www.slinkp.com



More information about the Python-list mailing list