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.00134.019,4281004  0% 0% 1% 100%
1.0OCaml #3 0.00107.8218,9481017  0% 1% 1% 100%
6,806C++ g++ #7 27.2227.232841150  0% 1% 1% 100%
6,814C gcc #4 27.2627.273161183  0% 0% 1% 100%
9,456C gcc #5 37.8237.84340910  2% 2% 2% 100%
9,822Ada 2005 GNAT #3 39.2939.311,6242100  0% 1% 1% 100%
11,444Rust 45.7845.796,8681188  0% 1% 1% 100%
11,995C gcc #3 47.9847.99312567  0% 0% 1% 100%
12,488C++ g++ #5 49.9549.971,0361440  0% 0% 1% 100%
13,094C++ g++ #4 52.3852.393,0841439  0% 1% 1% 100%
13,694C gcc #2 54.7854.793481557  1% 1% 0% 100%
14,135Haskell GHC #3 56.5456.561,9401153  1% 0% 0% 100%
14,464C++ g++ #3 57.8657.87284593  1% 0% 0% 100%
14,467C gcc 57.8757.89316508  0% 0% 1% 100%
14,749Scala #2 59.0059.0125,1841017  1% 1% 0% 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,121C# Mono #2 64.4864.5018,616564  0% 1% 0% 100%
16,871Java  67.4867.5021,4481282  1% 1% 0% 100%
16,886Pascal Free Pascal 67.5467.576921018  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%
18,019F# Mono #4 72.0872.1019,124612  0% 0% 0% 100%
18,116JavaScript V8 #3 72.4672.486,152539  0% 1% 1% 100%
19,117Dart #2 76.4776.5020,876495  0% 1% 1% 100%
19,508Java  #2 78.0378.0519,996514  0% 1% 1% 100%
20,301Haskell GHC #5 81.2081.231,936834  1% 0% 0% 100%
20,552Haskell GHC #4 82.2182.231,680658  1% 0% 0% 100%
20,580JavaScript V8 #2 82.3282.346,140472  0% 1% 1% 100%
20,835OCaml #2 83.3483.36604473  0% 1% 1% 100%
21,804JavaScript V8 87.2287.246,072463  0% 1% 1% 100%
22,201C# Mono 88.8088.8318,624520  0% 1% 0% 100%
24,400Scala 97.6097.6322,360459  1% 0% 1% 100%
25,543F# Mono #2 102.17102.2020,688548  0% 1% 1% 100%
25,821Go 103.28103.32764900  0% 1% 1% 100%
28,724C# Mono #3 114.90114.9219,6241096  0% 1% 1% 100%
31,270F# Mono #3 125.08125.1122,688945  0% 1% 1% 100%
36,013Clojure #3 144.05144.1051,4761491  0% 1% 1% 100%
38,430OCaml 153.72153.75600524  1% 1% 0% 100%
39,791Lisp SBCL #2 159.16159.2441,088513  0% 1% 1% 100%
41,972F# Mono 167.89168.0021,524551  0% 1% 1% 100%
63,414Haskell GHC #2 253.66253.743,248808  1% 1% 0% 100%
65,699Clojure #2 262.80262.9156,1361088  0% 1% 1% 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%
96,655Erlang HiPE 6 min6 min10,1841038  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++ Failed1059
Perl #2 Failed565
Ruby #2 Timed Out1h 00 min1426
Rust #2 Make Error1102
"wrong" (different) algorithm / less comparable programs
9,124C++ g++ #6 36.5036.51284894
11,358Java  #3 45.4345.4522,8681633
13,357Lisp SBCL 53.4353.4432,3641607
21,585C# Mono #4 86.3486.3618,880710
28,573C# Mono #5 114.29114.3221,0121400
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