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.00107.8218,9481017  0% 1% 1% 100%
1.0OCaml #4 0.00134.019,4281004  0% 0% 1% 100%
6,079C gcc #4 24.3224.336601183  1% 0% 1% 100%
6,112C++ g++ #7 24.4524.465841150  1% 0% 1% 100%
9,859C gcc #5 39.4439.451,384910  1% 0% 0% 100%
11,675Rust #2 46.7046.728,1401191  1% 0% 0% 100%
11,910C# Mono #2 47.6447.6638,384564  0% 1% 1% 100%
12,065C gcc #3 48.2648.28664567  1% 0% 0% 100%
12,611Ada 2005 GNAT #3 50.4450.473,9282100  1% 0% 1% 100%
12,705C++ g++ #4 50.8250.841,4041439  0% 0% 1% 100%
12,749C++ g++ #5 51.0051.021,4121440  1% 1% 0% 100%
13,196C gcc #2 52.7852.807321557  1% 0% 0% 100%
14,135Haskell GHC #3 56.5456.561,9401153  1% 0% 0% 100%
14,319C++ g++ #3 57.2857.29624593  1% 0% 0% 100%
14,695Scala #2 58.7858.8129,8161017  2% 1% 1% 100%
15,394Lisp SBCL #4 61.5861.5925,4961518  0% 1% 1% 100%
15,590Lisp SBCL #5 62.3662.3821,860674  0% 0% 0% 100%
16,886Pascal Free Pascal 67.5467.576921018  1% 1% 0% 100%
16,908Java  67.6367.6626,6441282  1% 1% 0% 100%
16,978Fortran Intel #3 67.9167.937,4561148  1% 0% 1% 100%
17,169Lisp SBCL #3 68.6868.7017,068821  1% 1% 1% 100%
17,326Fortran Intel 69.3069.32260590  0% 1% 1% 100%
17,494F# Mono #4 69.9870.0039,496612  0% 1% 1% 100%
17,841JavaScript V8 #3 71.3671.3910,572539  1% 0% 0% 100%
18,446Java  #2 73.7873.8124,652514  1% 0% 0% 100%
18,468C gcc 73.8773.90656508  1% 0% 0% 100%
19,089Dart #2 76.3676.3823,052495  0% 0% 0% 100%
20,301Haskell GHC #5 81.2081.231,936834  1% 0% 0% 100%
20,319JavaScript V8 #2 81.2881.3010,536472  1% 1% 0% 100%
20,552Haskell GHC #4 82.2182.231,680658  1% 0% 0% 100%
20,835OCaml #2 83.3483.36604473  0% 1% 1% 100%
21,453C# Mono 85.8185.8338,384520  1% 0% 0% 100%
21,919JavaScript V8 87.6887.7110,556463  1% 1% 1% 100%
25,718F# Mono #2 102.87102.9043,788548  1% 0% 0% 100%
25,821Go 103.28103.32764900  0% 1% 1% 100%
26,352Scala 105.41105.4528,932459  2% 0% 1% 100%
28,709C# Mono #3 114.84114.8739,3841096  1% 0% 0% 100%
30,256F# Mono #3 121.02121.0644,728945  1% 0% 0% 100%
37,078Clojure #3 148.31148.3657,4321491  1% 0% 0% 100%
38,430OCaml 153.72153.75600524  1% 1% 0% 100%
39,791Lisp SBCL #2 159.16159.2441,088513  0% 1% 1% 100%
45,163F# Mono 180.65180.8342,056551  0% 1% 1% 100%
59,514Clojure #2 238.06238.1861,1801252  1% 0% 0% 100%
63,414Haskell GHC #2 253.66253.743,248808  1% 1% 0% 100%
75,742Racket #2 5 min5 min18,376903  0% 1% 0% 100%
79,698Racket 5 min5 min17,132649  1% 1% 0% 100%
80,327Racket #3 5 min5 min19,7961096  1% 1% 1% 100%
98,887Erlang HiPE 6 min6 min11,4081038  1% 0% 0% 100%
112,310Haskell GHC 7 min7 min3,268553  1% 0% 0% 100%
151,115Smalltalk VisualWorks 10 min10 min24,332838  3% 5% 2% 100%
180,104Ruby JRuby 12 min12 min648,500384  0% 1% 1% 100%
470,590Ruby JRuby #2 31 min31 min638,7521426  0% 1% 1% 100%
616,899Python 3 #4 41 min41 min28,000944  1% 1% 0% 100%
618,805PHP #3 41 min41 min11,0081150  1% 1% 0% 100%
627,323Perl 41 min41 min1,468457  0% 1% 1% 100%
636,874PHP #2 42 min42 min2,548441  0% 0% 1% 100%
648,261Lua 43 min43 min820462  1% 0% 1% 100%
680,537Ruby 45 min45 min5,036384  0% 0% 1% 100%
733,244Python 3 #6 48 min48 min4,168385  0% 0% 1% 100%
792,911PHP 52 min52 min2,584482  0% 0% 1% 100%
2,668,038C CINT 2h 57 min2h 57 min5,116536  0% 0% 0% 100%
C++ g++ Make Error1059
Perl #2 Failed565
Ruby #2 Timed Out1h 00 min1426
"wrong" (different) algorithm / less comparable programs
9,063C++ g++ #6 36.2536.27588894
11,567Java  #3 46.2746.2925,5881633
13,357Lisp SBCL 53.4353.4432,3641607
23,265C# Mono #4 93.0693.0938,648710
32,138C# Mono #5 128.55128.5940,7441400
576,094Python 3 #3 2304.382.0027,948773

 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