recursive benchmark hypotheses non fingo

↓ Naive recursive-algorithms: ack fib tak, N=11.

Which programs used least Code? Which programs use highly optimised assembly code libraries? Which programs make use of all the processor cores?

    sort sort sort sort
  ×   Program & Logs CPU secs Elapsed secs Memory KB Code B ~ CPU Load
1.0GNU gcc 2.36432547  
1.0C++ GNU g++ #2 2.401,008566  
1.0Lisaac 2.45524590  
1.1Ada 2005 GNAT #2 2.51548598  
1.1GNU gcc #2 2.54484425  
1.1Oberon-2 OO2C 2.541,784505  
1.1C++ GNU g++ 2.59916345  
1.1Eiffel SmartEiffel 2.63584579  
1.4Mercury 3.233,720545  
1.4Intel 3.24692547  
1.4Intel #2 3.28700425  
1.6Clean #4 3.80596422  
1.6C++ Intel #2 3.83724566  
1.7Mercury #2 3.943,740696  
1.7Clean #3 4.10600427  
1.7C++ Intel 4.11512345  
1.8Pascal Free Pascal 4.14460462  
2.0Java 1.4 -server 4.8110,464497  
2.5CAL 5.8014,320665  
2.7Digital Mars #2 6.311,196349  
2.8Scala #2 6.5320,184411  
2.9Java 6 -server 6.7612,044427  
2.9Java 6 -Xms64m 6.8212,180427  
3.0Fortran Intel 7.17880620  
3.2OCaml #2 7.471,120389  
3.3F# Mono 7.707,500461  
3.4BASIC FreeBASIC #2 7.941,068449  
3.4SML MLton #2 7.971,384453  
3.4Java GNU gcj 7.9815,828497  
3.4Haskell GHC 8.051,464447  
3.6Lisp SBCL #3 8.4517,460523  
3.7Scheme Chicken 8.682,384467  
3.7Forth bigForth 8.77872413  
3.9C# Mono 9.225,060435  
4.0SML SML/NJ 9.425,244585  
4.0Java 6 -client 9.4310,716427  
4.6Scheme Ikarus 10.8120,880564  
4.6Nice 10.8624,328377  
4.6Nice #2 10.8923,792393  
4.7Fortran G95 10.981,244620  
8.1Scheme PLT 19.076,988579  
8.4Scheme PLT #2 19.827,708427  
11Erlang HiPE #2 26.454,856392  
15Python Psyco 36.123,420354  
18Forth GNU GForth 43.30956493  
21Lua LuaJIT 48.672,912330  
24Java 6 -Xint 55.6610,520427  
38Mozart/Oz 89.355,192574  
40Mozart/Oz #2 93.066,100500  
47Prolog YAP 111.6522,820493  
49Lua 114.382,280330  
66Pike 154.915,312403  
69Smalltalk VisualWorks 161.8332,764509  
80Python IronPython 187.6519,588360  
146Prolog SWI 5 min3,320587  
238Groovy 9 min63,848361  
290Python CPython 11 min14,296360  
305Ruby JRuby #2 11 min49,096301  
373PHP #2 14 min18,088315  
381Perl #2 14 min10,836380  
543Tcl 21 min24,908461  
629Ruby MRI #2 24 min48,360301  
636Smalltalk Squeak 24 min20,736505  
7,140Io 4h 40 min58,540331  
CINT Timed Out403
Erlang HiPE Failed356
Erlang HiPE #3 Failed373
Icon Failed311
JavaScript Rhino Failed306
JavaScript SpiderMonkey Failed306
Rebol Failed504
Ruby 1.9 #2 Failed301
Scala Failed420
Smalltalk GNU Failed510
Zonnon Mono Failed493

 recursive benchmark : Naive recursive-algorithms: ack fib tak

diff program output N = 3 with this output file to check your program is correct before contributing.

Each program should use the same naïve recursive-algorithms to calculate 3 simple numeric functions: ackermann, fibonnaci and tak.

Ack(x,y)
  x = 0     = y+1
  y = 0     = Ack(x-1,1)
  otherwise = Ack(x-1, Ack(x,y-1))

Fib(n)
  n < 2     = 1
  otherwise = Fib(n-2) + Fib(n-1)

Tak(x,y,z)
  y < x     = Tak(Tak(x-1.0,y,z),Tak(y-1.0,z,x),Tak(z-1.0,x,y))
  otherwise = z

For this benchmark, the fibonnaci and tak implementations should either provide separate functions - one for integer calculation and one for double calculation - or provide a function that uses integer calculation with integer parameters and double calculation with double parameters.


The Ackermann benchmark is described in Timing Trials, or, the Trials of Timing: Experiments with Scripting and User-Interface Languages.

For more information see Eric W. Weisstein, "Ackermann Function." From MathWorld--A Wolfram Web Resource.
http://mathworld.wolfram.com/AckermannFunction.html

For a different version of the Fibonacci function see Eric W. Weisstein, "Fibonacci Number." From MathWorld--A Wolfram Web Resource.
http://mathworld.wolfram.com/FibonacciNumber.html

The tak benchmark is described in Performance and Evaluation of Lisp Systems, Richard P. Gabriel, 1985, page 81. (1.1MB pdf)

For more information see Eric W. Weisstein, "TAK Function." From MathWorld--A Wolfram Web Resource.
http://mathworld.wolfram.com/TAKFunction.html

Revised BSD license