/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.889,1361004  0% 0% 0% 100%
1.0OCaml #3 0.00105.2618,6801017  0% 1% 0% 100%
6,805C++ g++ #7 27.2227.232961150  1% 0% 0% 100%
6,810C gcc #4 27.2427.253281183  1% 0% 0% 100%
9,820Ada 2005 GNAT #3 39.2839.311,6522100  0% 0% 1% 100%
11,872C gcc #3 47.4947.51328567  1% 0% 0% 100%
13,691C gcc #2 54.7654.783561557  0% 0% 0% 100%
13,799C# Mono #2 55.2055.2214,640564  0% 0% 1% 100%
14,354C++ g++ #3 57.4257.43296593  1% 1% 1% 100%
14,460Lisp SBCL #5 57.8457.8620,716674  0% 0% 1% 100%
15,032C gcc 60.1360.15328508  0% 0% 0% 100%
15,271Scala #2 61.0861.1119,8601017  1% 1% 0% 100%
15,560Haskell GHC #3 62.2462.261,9881153  0% 0% 1% 100%
15,922Lisp SBCL #4 63.6963.7014,4641518  0% 0% 1% 100%
16,332Pascal Free Pascal 65.3365.357441018  0% 0% 0% 100%
16,851Java  67.4067.4315,7201282  1% 1% 0% 100%
17,076Fortran Intel 68.3068.32260590  0% 0% 0% 100%
17,151Lisp SBCL #3 68.6068.6214,100821  0% 0% 0% 100%
17,423Fortran Intel #3 69.6969.717,5801148  0% 0% 0% 100%
17,774OCaml #2 71.1071.12596473  0% 0% 0% 100%
18,754JavaScript V8 #3 75.0275.046,300539  0% 0% 0% 100%
18,854Haskell GHC #5 75.4275.441,976834  0% 0% 1% 100%
19,893JavaScript V8 #2 79.5779.596,288472  1% 0% 0% 100%
19,948Dart #2 79.7979.8286,524495  0% 1% 1% 100%
20,600Haskell GHC #4 82.4082.431,720658  0% 1% 0% 100%
21,001F# Mono #4 84.0084.0315,220612  0% 0% 0% 100%
22,302JavaScript V8 89.2189.236,256463  1% 0% 0% 100%
22,482Java  #2 89.9389.9616,052514  0% 1% 0% 100%
23,410Rust 93.6493.67676601  0% 0% 1% 100%
24,455Scala 97.8297.8519,060459  0% 1% 0% 100%
24,613C# Mono 98.4598.4814,376520  0% 0% 1% 100%
26,863Go 107.45107.48720900  1% 1% 1% 100%
27,405F# Mono #2 109.62109.6515,744548  0% 0% 0% 100%
28,482C# Mono #3 113.93113.9715,1801096  0% 0% 0% 100%
30,177F# Mono #3 120.71120.7518,120945  1% 1% 1% 100%
33,088OCaml 132.35132.39592524  0% 0% 0% 100%
36,432Clojure #3 145.73145.7847,1361491  1% 1% 1% 100%
46,038Lisp SBCL #2 184.15184.2735,144513  0% 1% 1% 100%
49,652F# Mono 198.61198.7419,964551  0% 1% 1% 100%
63,315Haskell GHC #2 253.26253.363,284808  0% 1% 1% 100%
65,153Clojure #2 260.61260.7352,4601088  0% 1% 1% 100%
75,665Racket #2 5 min5 min16,856903  0% 1% 1% 100%
80,335Racket 5 min5 min15,368649  0% 0% 1% 100%
80,950Racket #3 5 min5 min17,1841096  0% 0% 1% 100%
94,920Erlang HiPE 6 min6 min7,6441038  0% 0% 0% 100%
110,308Haskell GHC 7 min7 min3,308553  0% 1% 1% 100%
150,367Smalltalk VisualWorks 10 min10 min21,952838  0% 0% 0% 100%
219,424Ruby JRuby 14 min14 min616,088384  0% 1% 1% 100%
532,776Lua 35 min35 min820462  0% 0% 0% 100%
607,156Perl 40 min40 min1,464457  0% 0% 0% 100%
639,701PHP #2 42 min42 min2,540441  0% 0% 0% 100%
662,446Python 3 #6 44 min44 min4,192385  0% 0% 0% 100%
690,436PHP #3 46 min46 min10,4121150  0% 0% 0% 100%
798,242Ruby 53 min53 min5,284384  0% 1% 1% 100%
817,416PHP 54 min54 min2,572482  0% 0% 0% 100%
2,668,038C CINT 2h 57 min2h 57 min5,116536  0% 0% 0% 100%
C++ g++ Failed1059
C++ g++ #4 Make Error1439
C++ g++ #5 Make Error1440
Dart Failed531
Perl #2 Failed565
Python 3 #2 Timed Out1h 00 min797
Python 3 Timed Out1h 00 min1108
"wrong" (different) algorithm / less comparable programs
9,124C++ g++ #6 36.5036.51296894
11,342Java  #3 45.3745.3917,0841633
12,619Lisp SBCL 50.4850.4919,0841607

 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