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.

    sort sortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0C gcc #5 34.618.854,520910  99% 98% 100% 94%
1.1Ada 2005 GNAT #3 38.259.611,9762100  100% 99% 100% 100%
1.4Rust #2 50.0112.817,0721180  99% 100% 97% 95%
1.5Fortran Intel #3 51.2012.848,5641148  100% 100% 100% 100%
1.5C++ g++ #5 53.3313.631,2641440  100% 98% 99% 94%
1.6C++ g++ #4 53.5613.731,2641439  99% 100% 98% 94%
1.6C gcc #2 55.4814.254281557  98% 96% 96% 100%
1.7Rust 58.4714.6739,788644  100% 100% 100% 100%
1.8Haskell GHC #5 63.3916.154,036834  99% 100% 100% 94%
1.8OCaml #4 0.0016.3011,2801004  100% 100% 100% 100%
1.9Lisp SBCL #4 65.1216.7534,0041518  98% 99% 100% 92%
1.9Go 67.1616.861,032900  100% 100% 100% 100%
2.0OCaml #3 0.0117.3621,3721017  100% 100% 100% 100%
2.0Java  70.0617.7319,7201282  99% 99% 98% 99%
2.0Scala #2 69.8917.7725,6401017  97% 98% 100% 98%
2.4Clojure #3 82.0121.3359,1761491  99% 95% 96% 96%
2.5Pascal Free Pascal 87.2821.877521018  100% 100% 100% 100%
2.5C# Mono #3 87.6822.2922,9601096  97% 99% 98% 99%
2.5F# Mono #3 84.1522.3832,076945  92% 96% 93% 96%
2.6C gcc #4 22.6622.673921183  0% 1% 100% 0%
2.6C++ g++ #7 22.6922.703601150  1% 0% 1% 100%
5.5C# Mono #2 48.9748.9819,568564  0% 1% 1% 100%
5.9Clojure #2 166.4852.0762,9601088  80% 80% 79% 79%
5.9C gcc #3 52.4452.47392567  1% 99% 1% 2%
6.7Fortran Intel 58.8258.84520590  0% 0% 0% 100%
6.7C++ g++ #3 59.1559.17360593  1% 100% 0% 0%
6.7Lisp SBCL #5 59.4659.4834,456674  1% 0% 1% 100%
7.1C gcc 63.1763.19392508  1% 1% 100% 0%
7.2F# Mono #4 63.7263.7420,372612  0% 0% 100% 0%
7.5Haskell GHC #4 71.1466.002,460658  3% 3% 3% 100%
7.9Java  #2 69.6169.5719,664514  0% 99% 1% 1%
7.9C# Mono 69.8969.9121,348520  0% 0% 100% 1%
8.2Racket #3 286.8072.7320,6761096  100% 95% 100% 100%
8.4Lisp SBCL #3 74.1474.1723,504821  100% 0% 0% 1%
9.4Dart #2 83.5182.7324,464495  1% 1% 0% 100%
9.5F# Mono #2 84.3584.3821,244548  0% 1% 100% 0%
10Scala 88.7688.7023,636459  1% 1% 99% 0%
10OCaml #2 90.3990.42764473  93% 0% 0% 7%
12OCaml 106.38106.41764524  96% 0% 0% 4%
14Erlang HiPE 8 min125.7312,8721038  99% 100% 97% 97%
16F# Mono 144.24144.1324,672551  68% 18% 10% 5%
18Haskell GHC #2 8 min162.275,344808  83% 83% 83% 82%
21Lisp SBCL #2 188.07188.3878,600513  49% 1% 1% 51%
23Erlang 13 min203.7611,7961038  100% 98% 100% 100%
31Racket #2 272.16272.1420,220903  0% 1% 100% 0%
34Racket 297.55297.5218,840649  1% 41% 0% 59%
55Ruby JRuby #2 30 min8 min650,4721426  98% 91% 94% 90%
60Perl #2 35 min8 min8,720565  100% 99% 99% 99%
61Haskell GHC 12 min8 min3,948553  55% 28% 32% 25%
87Ruby JRuby 12 min12 min632,076384  33% 21% 24% 24%
92Ruby #2 52 min13 min31,5121426  98% 97% 97% 98%
98PHP #3 56 min14 min14,9681150  99% 98% 99% 95%
103Hack 15 min15 min82,936532  21% 80% 1% 0%
103Python 3 #2 59 min15 min40,096797  98% 97% 100% 97%
113Python 3 1h 05 min16 min40,1001108  99% 100% 99% 100%
258Hack #2 38 min38 min80,908440  53% 47% 1% 0%
264Python 3 #6 38 min38 min5,428385  1% 0% 0% 100%
275Ruby 40 min40 min7,508384  0% 0% 0% 100%
296Perl 43 min43 min1,864457  0% 0% 0% 100%
331PHP #2 48 min48 min3,256441  100% 0% 0% 0%
387PHP 57 min57 min3,312482  3% 97% 0% 0%
C++ g++ Failed1059
Haskell GHC #3 Timed Out5 min1153
Hack #3 Failed1150
"wrong" (different) algorithm / less comparable programs
1.2Java  #3 40.9810.4121,0321633
1.4C# Mono #5 46.8912.0024,8681400
1.5Lisp SBCL 52.3813.2843,6841607
4.3C++ g++ #6 37.8637.87364894
4.6C# Mono #4 40.2440.2619,568710

 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