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.0133.609,4281004  100% 100% 100% 100%
1.0OCaml #3 0.0127.0818,9601017  100% 100% 100% 100%
3,041C gcc #4 24.3324.346721183  100% 0% 0% 0%
3,056C++ g++ #7 24.4424.455881150  0% 100% 1% 1%
4,937C gcc #5 39.4910.061,388910  99% 99% 95% 100%
5,850Rust #2 46.8011.9312,0881191  96% 98% 100% 99%
5,957C# Mono #2 47.6647.6738,336564  1% 100% 1% 1%
6,032C gcc #3 48.2548.27680567  1% 0% 0% 100%
6,306Ada 2005 GNAT #3 50.4512.663,9282100  100% 100% 100% 100%
6,358C++ g++ #4 50.8613.041,4161439  99% 93% 98% 100%
6,366C++ g++ #5 50.9313.021,4121440  100% 94% 99% 100%
6,785C gcc #2 54.2814.138721557  100% 89% 99% 97%
6,795Haskell GHC #3 54.3613.893,4241153  98% 98% 100% 95%
7,170C++ g++ #3 57.3657.38564593  1% 1% 100% 1%
7,673Lisp SBCL #4 61.3815.7925,4961518  95% 98% 98% 99%
7,793Lisp SBCL #5 62.3462.3621,860674  0% 0% 100% 0%
8,259Scala #2 66.0716.8631,8121017  98% 98% 99% 97%
8,302Fortran Intel 66.4266.43520590  0% 1% 1% 100%
8,442Pascal Free Pascal 67.5416.936961018  100% 100% 100% 100%
8,445Java  67.5617.1325,8041282  100% 98% 99% 98%
8,572Lisp SBCL #3 68.5768.5917,068821  1% 0% 1% 100%
8,745F# Mono #4 69.9669.9839,508612  100% 1% 1% 0%
9,234C gcc 73.8773.89656508  1% 0% 0% 100%
9,245Java  #2 73.9673.9223,796514  1% 1% 99% 1%
9,397Fortran Intel #3 75.1818.8512,4641148  100% 100% 100% 100%
9,533Dart #2 76.2675.8124,256495  87% 1% 1% 13%
10,031Haskell GHC #5 80.2520.473,712834  98% 99% 95% 100%
10,418OCaml #2 83.3483.36604473  0% 1% 1% 100%
10,728C# Mono 85.8285.8538,364520  0% 0% 100% 1%
11,171Haskell GHC #4 89.3686.6210,088658  2% 1% 1% 100%
12,632Scala 101.06101.0028,520459  92% 8% 1% 1%
12,859F# Mono #2 102.87102.9041,276548  1% 63% 38% 0%
12,898Go 103.1825.97760900  99% 99% 100% 100%
14,080C# Mono #3 112.6428.7739,3641096  99% 99% 98% 96%
15,120F# Mono #3 120.9632.4546,616945  94% 97% 87% 95%
16,971Clojure #3 135.7735.2255,0081491  98% 99% 98% 99%
19,315OCaml 154.52154.55604524  1% 1% 1% 100%
19,891Lisp SBCL #2 159.13159.2141,084513  1% 0% 100% 1%
22,783F# Mono 182.26182.4341,908551  1% 9% 92% 1%
38,016Clojure #2 5 min91.4559,0561252  83% 83% 83% 83%
40,290Racket 5 min5 min16,876649  0% 26% 1% 75%
41,032Racket #3 5 min83.6318,3761096  97% 99% 98% 100%
44,887Racket #2 5 min5 min22,432903  0% 1% 100% 0%
50,691Erlang HiPE 6 min102.5312,9441038  100% 98% 98% 100%
53,892Haskell GHC #2 7 min143.655,020808  75% 76% 75% 75%
80,869Haskell GHC 10 min8 min9,592553  25% 44% 18% 42%
156,330Ruby JRuby 20 min20 min678,724384  48% 16% 23% 16%
297,619Perl #2 39 min9 min12,380565  100% 100% 99% 99%
306,808PHP #2 40 min40 min2,556441  99% 1% 1% 2%
313,284PHP #3 41 min10 min10,5161150  100% 99% 99% 100%
322,873Python 3 #4 43 min10 min28,068944  100% 99% 98% 98%
327,496Ruby JRuby #2 43 min12 min661,1681426  91% 89% 98% 86%
342,805Python 3 #6 45 min45 min4,180385  0% 100% 1% 1%
352,100Perl 46 min46 min1,768457  21% 0% 79% 1%
352,960Ruby 47 min47 min5,172384  97% 1% 4% 0%
397,518PHP 53 min53 min2,588482  0% 1% 1% 100%
549,963Ruby #2 1h 13 min18 min18,5281426  98% 96% 100% 97%
C++ g++ Make Error1059
"wrong" (different) algorithm / less comparable programs
4,544C++ g++ #6 36.3536.36628894
5,162Java  #3 41.2910.5327,3521633
6,668Lisp SBCL 53.3413.4932,3641607
11,633C# Mono #4 93.0693.0938,584710
16,669C# Mono #5 133.3533.9940,5841400
285,857Python 3 #3 2286.85578.4928,040773

 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