What can you do when you are to tired to do anything useful but the level of caffeine in your blood is to high for sleeping?
Watching a TV could be a good choice, but who could resist writing a simple Fibonacci recursion in every programming language that you could think of and measuring the calculation time? I couldn’t.
So here are the results of my very scientific study for Fibonacci 33
- c
gcc4.4.1 0.153s - go
8g 0.189s - java
1.6.0_15 0.267s - scala
2.7.5 0.324s - javascript
node.js V8 0.346s - haskell
ghc6.10.4 1.675s - lisp
clisp2.44.1 1.888s - ruby
1.8: 22.614s
1.91: 2.757s - python
2.6.4: 4.401s
3.1.1: 5.545s
cxfreeze4.0.1 5.704s - php
5.2.10 10.341s - prolog
sicstus4.0.2 >10m (didn’t have patience to wait)
swi5.6.64 Out of local stack
I have some more ideas, but caffeine level is dropping fast.
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=5727bdf2-df6e-4112-a421-8cad179d895b)








The fib function is part of the recursive benchmark on the Language Benchmarks Game. See the results for dozens of languages here: http://shootout.alioth.debian.org/gp4/benchmark.php?test=recursive
See the up-to-date results for dozens of languages here:
http://shootout.alioth.debian.org/