by apgwoz · 17y ago · 0 comments
I just rewrote it in C though:
$ time ./fib 40
102334155
real 0m3.063s
user 0m2.912s
sys 0m0.014s
Which makes the python version something like 35x slower in wall clock time. $ time python fib.py 40
102334155
real 0m0.013s
user 0m0.000s
sys 0m0.010s # 400
$ time ruby fib.rb
real 0m0.017s
user 0m0.010s
sys 0m0.006s
# 400
$ time python fib.py
real 0m0.023s
user 0m0.011s
sys 0m0.011sthat should have stated "equivalent python code"