/mobile Handheld Friendly website

 fannkuch-redux benchmark N=12

Each chart bar shows how many times slower, one ↓ fannkuch-redux program was, compared to the fastest program.

These are not the only programs that could be written. These are not the only compilers and interpreters. These are not the only programming languages.

Column × shows how many times more each program used compared to the benchmark program that used least.

     sortsortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0OCaml #4 0.00133.228,9961004  0% 0% 0% 100%
1.0OCaml #3 0.00103.9618,5201017  0% 1% 0% 100%
6,152C gcc #4 24.6124.622921183  1% 0% 0% 100%
6,259C++ g++ #7 25.0425.052921150  1% 0% 0% 100%
9,823Ada 2005 GNAT #3 39.2939.321,6522100  0% 1% 0% 100%
11,192C gcc #3 44.7744.79288567  0% 0% 0% 100%
12,415C++ g++ #5 49.6649.681,0001440  0% 0% 0% 100%
12,642C++ g++ #3 50.5750.59292593  0% 0% 0% 100%
12,692C gcc #2 50.7750.793321557  0% 0% 0% 100%
13,454C++ g++ 53.8253.849321059  0% 0% 0% 100%
14,139Scala #2 56.5656.5820,4721017  0% 1% 0% 100%
14,233C gcc 56.9356.96292508  0% 0% 0% 100%
14,322Lisp SBCL #4 57.2957.3114,1081518  0% 0% 0% 100%
14,451ATS #2 57.8057.822881571  0% 0% 0% 100%
14,564ATS 58.2658.272881306  0% 0% 0% 100%
15,371Lisp SBCL #3 61.4861.5013,744821  0% 0% 0% 100%
15,465C++ g++ #4 61.8661.891,0041439  0% 0% 0% 100%
15,981Haskell GHC #3 63.9263.941,5881153  0% 0% 0% 100%
16,332Pascal Free Pascal 65.3365.357441018  0% 0% 0% 100%
17,076Fortran Intel 68.3068.32260590  0% 0% 0% 100%
17,294C# Mono #2 69.1869.1913,548564  0% 0% 0% 100%
17,423Fortran Intel #3 69.6969.717,5801148  0% 0% 0% 100%
17,816Java 7  71.2671.2813,9361282  0% 0% 0% 100%
18,326JavaScript V8 #3 73.3073.335,288539  0% 0% 0% 100%
18,364OCaml #2 73.4673.47580473  0% 0% 0% 100%
19,688Dart #2 78.7578.776,264538  0% 0% 0% 100%
20,184JavaScript V8 #2 80.7480.765,268472  0% 0% 0% 100%
21,178Go 84.7184.751,012900  0% 0% 0% 100%
22,584Haskell GHC #4 90.3390.361,836658  0% 0% 0% 100%
24,398Scala 97.5997.6218,696459  0% 1% 0% 100%
25,479Lisp SBCL #2 101.92101.953,828513  0% 0% 0% 100%
25,493JavaScript V8 101.97102.015,248463  0% 0% 0% 100%
25,686Java 7  #2 102.74102.7714,420514  0% 0% 0% 100%
28,404F# Mono #2 113.62113.6415,148548  0% 0% 0% 100%
29,149C# Mono 116.60116.6213,520520  0% 0% 0% 100%
33,500C# Mono #3 134.00134.0314,3401096  0% 0% 0% 100%
34,236F# Mono #3 136.95136.9816,964945  1% 0% 0% 100%
36,745OCaml 146.98147.01576524  0% 0% 0% 100%
70,238Clojure #2 280.95281.0866,0881088  0% 0% 0% 100%
72,272Haskell GHC #2 289.09289.193,160808  0% 0% 0% 100%
78,517Racket 5 min5 min15,332649  0% 0% 0% 100%
78,740F# Mono 5 min5 min15,152551  0% 0% 0% 100%
94,920Erlang HiPE 6 min6 min7,6441038  0% 0% 0% 100%
135,471Haskell GHC 9 min9 min3,164553  0% 0% 0% 100%
150,367Smalltalk VisualWorks 10 min10 min21,952838  0% 0% 0% 100%
236,858Ruby JRuby 15 min15 min583,116384  0% 0% 0% 100%
353,665Dart 23 min23 min5,980531  0% 0% 0% 100%
532,776Lua 35 min35 min820462  0% 0% 0% 100%
607,156Perl 40 min40 min1,464457  0% 0% 0% 100%
676,838PHP #2 45 min45 min2,476441  0% 0% 0% 100%
719,763PHP #3 47 min47 min10,1321150  0% 0% 0% 100%
725,800Python 3 #6 48 min53 min4,564385  0% 0% 0% 100%
890,955PHP 59 min59 min2,508482  0% 0% 0% 100%
1,003,600Ruby 2.0 1h 06 min1h 06 min4,864384  0% 0% 0% 100%
2,668,038C CINT 2h 57 min2h 57 min5,116536  0% 0% 0% 100%
Python 3 #2 Timed Out1h 00 min797
Python 3 Timed Out1h 00 min1108
"wrong" (different) algorithm / less comparable programs
7,278C++ g++ #2 29.1129.139882106
9,556C++ g++ #6 38.2238.24292894
10,334Java 7  #3 41.3441.3515,6881633
11,664Lisp SBCL 46.6646.6818,5281607

 fannkuch-redux benchmark : Indexed-access to tiny integer-sequence

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

We are trying to show the performance of various programming language implementations - so we ask that contributed programs not only give the correct result, but also use the same algorithm to calculate that result.

For N = 7 programs should generate these permutations (40KB) - which, incidentally, seem to be in the same order as permutations generated by the Tompkins-Paige algorithm, see pages 150-151 Permutation Generation Methods Robert Sedgewick.

The fannkuch benchmark is defined by programs in Performing Lisp Analysis of the FANNKUCH Benchmark, Kenneth R. Anderson and Duane Rettig.

Each program should

The conjecture is that this maximum count is approximated by n*log(n) when n goes to infinity.

FANNKUCH is an abbreviation for the German word Pfannkuchen, or pancakes, in analogy to flipping pancakes.


Thanks to Oleg Mazurov for insisting on a checksum and providing this helpful description of the approach he took -

Revised BSD license

  Home   Conclusions   License   Play