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.0016.3011,2801004  100% 100% 100% 100%
2.0OCaml #3 0.0117.3621,3721017  100% 100% 100% 100%
5,665C gcc #4 22.6622.673921183  0% 1% 100% 0%
5,672C++ g++ #7 22.6922.703601150  1% 0% 1% 100%
8,653C gcc #5 34.618.854,520910  99% 98% 100% 94%
9,561Ada 2005 GNAT #3 38.259.611,9762100  100% 99% 100% 100%
12,242C# Mono #2 48.9748.9819,568564  0% 1% 1% 100%
12,503Rust #2 50.0112.817,0721180  99% 100% 97% 95%
12,801Fortran Intel #3 51.2012.848,5641148  100% 100% 100% 100%
13,032Scala #2 52.1313.3335,1321017  98% 98% 99% 97%
13,111C gcc #3 52.4452.47392567  1% 99% 1% 2%
13,333C++ g++ #5 53.3313.631,2641440  100% 98% 99% 94%
13,391C++ g++ #4 53.5613.731,2641439  99% 100% 98% 94%
13,870C gcc #2 55.4814.254281557  98% 96% 96% 100%
14,617Rust 58.4714.6739,788644  100% 100% 100% 100%
14,691Lisp SBCL #5 58.7658.7832,156674  1% 1% 1% 100%
14,705Fortran Intel 58.8258.84520590  0% 0% 0% 100%
14,787C++ g++ #3 59.1559.17360593  1% 100% 0% 0%
15,793C gcc 63.1763.19392508  1% 1% 100% 0%
15,848Haskell GHC #5 63.3916.154,036834  99% 100% 100% 94%
15,931F# Mono #4 63.7263.7420,372612  0% 0% 100% 0%
16,152Lisp SBCL #4 64.6116.6131,6441518  99% 98% 92% 100%
16,324Go 65.2916.461,024900  100% 99% 99% 99%
16,488Java  #2 65.9565.9136,436514  0% 0% 100% 1%
17,473C# Mono 69.8969.9121,348520  0% 0% 100% 1%
17,562Java  70.2517.8127,0481282  98% 99% 99% 99%
17,786Haskell GHC #4 71.1466.002,460658  3% 3% 3% 100%
18,371Lisp SBCL #3 73.4973.5123,208821  1% 0% 100% 0%
19,082Clojure #3 76.3319.9469,4561491  97% 97% 96% 95%
20,256Dart #2 81.0280.5822,668495  0% 1% 100% 1%
21,038F# Mono #3 84.1522.3832,076945  92% 96% 93% 96%
21,088F# Mono #2 84.3584.3821,244548  0% 1% 100% 0%
21,821Pascal Free Pascal 87.2821.877521018  100% 100% 100% 100%
21,919C# Mono #3 87.6822.2922,9601096  97% 99% 98% 99%
22,509Scala 90.0389.9939,800459  99% 1% 1% 1%
22,597OCaml #2 90.3990.42764473  93% 0% 0% 7%
26,594OCaml 106.38106.41764524  96% 0% 0% 4%
36,060F# Mono 144.24144.1324,672551  68% 18% 10% 5%
40,902Clojure #2 163.6153.1277,8561088  78% 75% 77% 76%
48,135Lisp SBCL #2 192.54192.7878,428513  53% 47% 1% 0%
68,041Racket #2 272.16272.1420,220903  0% 1% 100% 0%
71,701Racket #3 286.8072.7320,6761096  100% 95% 100% 100%
74,387Racket 297.55297.5218,840649  1% 41% 0% 59%
121,860Erlang HiPE 8 min124.5915,7321038  99% 99% 94% 100%
133,466Haskell GHC #2 8 min162.275,344808  83% 83% 83% 82%
159,610Ruby JRuby 10 min10 min675,384384  11% 30% 47% 15%
186,547Haskell GHC 12 min8 min3,948553  55% 28% 32% 25%
197,237Erlang 13 min201.1413,6921038  99% 97% 99% 98%
228,591Hack 15 min15 min82,936532  21% 80% 1% 0%
324,109Ruby JRuby #2 21 min5 min684,4681426  90% 92% 99% 82%
528,221Perl #2 35 min8 min8,720565  100% 99% 99% 99%
570,342Hack #2 38 min38 min80,908440  53% 47% 1% 0%
583,706Python 3 #6 38 min38 min5,428385  1% 0% 0% 100%
594,448Ruby 39 min39 min7,680384  53% 47% 0% 1%
653,893Perl 43 min43 min1,864457  0% 0% 0% 100%
731,545PHP #2 48 min48 min3,256441  100% 0% 0% 0%
799,265Ruby #2 53 min13 min30,5921426  96% 98% 96% 97%
843,083PHP #3 56 min14 min14,9681150  99% 98% 99% 95%
855,373PHP 57 min57 min3,312482  3% 97% 0% 0%
896,760Python 3 #2 59 min15 min40,096797  98% 97% 100% 97%
989,248Python 3 1h 05 min16 min40,1001108  99% 100% 99% 100%
C++ g++ Failed1059
Haskell GHC #3 Timed Out5 min1153
Hack #3 Failed1150
"wrong" (different) algorithm / less comparable programs
9,465C++ g++ #6 37.8637.87364894
10,061C# Mono #4 40.2440.2619,568710
10,270Java  #3 41.0810.4427,1761633
11,723C# Mono #5 46.8912.0024,8681400
13,057Lisp SBCL 52.2313.2345,2121607

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

You can write your own program for this task and contribute to the benchmarks game by following these general instructions.

More specifically:

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