/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 #3 0.0026.4218,6961017  100% 100% 100% 100%
1.0OCaml #4 0.0033.579,2681004  100% 100% 100% 100%
6,811C gcc #4 27.2427.253281183  1% 0% 0% 100%
6,821C++ g++ #7 27.2827.302961150  1% 1% 1% 100%
9,835Ada 2005 GNAT #3 39.349.931,6842100  100% 98% 99% 100%
11,877C gcc #3 47.5147.52328567  0% 1% 100% 0%
13,691C gcc #2 54.7614.223561557  91% 100% 96% 98%
13,799C# Mono #2 55.2055.2114,636564  0% 100% 1% 0%
14,374C++ g++ #3 57.5057.51296593  0% 1% 100% 0%
14,453Lisp SBCL #5 57.8157.8320,716674  1% 1% 1% 100%
14,941C gcc 59.7659.79328508  16% 20% 77% 63%
15,871Lisp SBCL #4 63.4816.4214,4641518  99% 96% 99% 100%
16,113Haskell GHC #3 64.4516.433,4521153  100% 100% 99% 94%
16,328Pascal Free Pascal 65.3116.367481018  100% 100% 100% 100%
16,722Fortran Intel #3 66.8916.858,5081148  100% 100% 100% 100%
17,011Java  68.0417.2515,6961282  99% 99% 97% 99%
17,102Fortran Intel 68.4168.43520590  100% 0% 0% 0%
17,153Lisp SBCL #3 68.6168.6414,100821  1% 100% 0% 0%
17,775OCaml #2 71.1071.12596473  0% 0% 0% 100%
18,472Scala #2 73.8918.7519,8201017  99% 99% 100% 97%
19,124Java  #2 76.5076.4616,164514  0% 99% 1% 1%
19,142Haskell GHC #5 76.5719.383,720834  100% 96% 100% 99%
19,945Dart #2 79.7879.2482,832495  0% 1% 100% 0%
21,006F# Mono #4 84.0284.0515,220612  1% 100% 0% 0%
21,864Haskell GHC #4 87.4684.031,932658  100% 2% 2% 2%
23,410Rust 93.6493.67676601  0% 1% 1% 100%
24,611C# Mono 98.4498.4714,372520  100% 0% 1% 0%
25,152Scala 100.61100.5518,988459  0% 1% 100% 0%
26,864Go 107.4626.96724900  100% 100% 100% 100%
27,407F# Mono #2 109.63109.6615,488548  1% 0% 0% 100%
28,497C# Mono #3 113.9928.9515,2281096  98% 99% 99% 98%
30,369F# Mono #3 121.4831.8819,176945  97% 92% 98% 93%
35,162OCaml 140.65140.69592524  0% 0% 0% 100%
37,224Clojure #3 148.9038.1048,5281491  97% 98% 98% 98%
46,037Lisp SBCL #2 184.15184.2735,144513  1% 0% 0% 100%
62,740F# Mono 250.96251.1320,772551  39% 1% 1% 60%
63,545Clojure #2 254.1874.0553,4441088  85% 86% 86% 84%
76,043Racket #2 5 min5 min16,876903  0% 0% 30% 70%
78,446Racket 5 min5 min15,364649  0% 1% 41% 60%
83,164Racket #3 5 min83.7717,1601096  99% 100% 99% 100%
101,163Erlang HiPE 6 min104.748,1801038  95% 99% 99% 94%
112,578Haskell GHC #2 7 min144.594,996808  79% 78% 78% 78%
144,650Haskell GHC 9 min7 min3,768553  71% 7% 7% 38%
222,727Ruby JRuby 14 min14 min620,384384  5% 41% 42% 22%
622,251Perl #2 41 min10 min6,292565  100% 100% 99% 100%
655,993Python 3 #6 43 min43 min4,200385  0% 0% 1% 100%
678,895PHP #2 45 min45 min2,544441  0% 0% 0% 100%
705,079Perl 47 min47 min1,752457  100% 0% 0% 0%
711,794PHP #3 47 min12 min10,5641150  91% 93% 99% 100%
769,754Ruby 51 min51 min5,288384  0% 0% 0% 100%
865,861PHP 57 min57 min2,576482  0% 98% 3% 0%
1,000,014Python 3 #2 1h 06 min16 min27,840797  99% 99% 98% 100%
1,097,826Python 3 1h 13 min18 min27,8881108  100% 99% 99% 98%
C++ g++ Failed1059
C++ g++ #4 Make Error1439
C++ g++ #5 Make Error1440
Dart Failed531
"wrong" (different) algorithm / less comparable programs
9,127C++ g++ #6 36.5136.52296894
10,227Java  #3 40.9110.4016,9921633
12,612Lisp SBCL 50.4512.7119,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