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.0164.7522,3081017  0% 0% 1% 100%
1.1OCaml #4 0.0165.8112,0441004  0% 0% 1% 100%
3,231C++ g++ #7 22.6222.636641150  1% 0% 0% 100%
3,231C gcc #4 22.6222.638081183  1% 2% 1% 100%
5,121C gcc #5 35.8435.851,520910  0% 0% 1% 100%
6,409Ada 2005 GNAT #3 44.8644.894,0842100  1% 1% 0% 100%
6,657C# Mono #2 46.6046.6139,628564  1% 0% 1% 100%
6,977Fortran Intel #3 48.8448.857,5201148  1% 1% 0% 100%
7,410C++ g++ #4 51.8751.891,8041439  1% 0% 0% 100%
7,553C++ g++ #5 52.8752.891,7761440  1% 0% 1% 100%
7,754C gcc #2 54.2854.309681557  0% 1% 1% 100%
7,762C gcc #3 54.3454.35820567  0% 1% 0% 100%
8,201Fortran Intel 57.4157.43256590  1% 0% 0% 100%
8,227Rust #2 57.5957.618,1761191  1% 1% 0% 100%
8,477Lisp SBCL #5 59.3459.3632,872674  1% 1% 0% 100%
8,508C++ g++ 59.5659.581,6521059  1% 0% 1% 100%
9,086F# Mono #4 63.6063.6240,688612  0% 0% 1% 100%
9,273Lisp SBCL #4 64.9164.9332,1481518  0% 1% 1% 100%
9,325Go 65.2765.291,024900  0% 0% 1% 100%
9,766C++ g++ #3 68.3668.38748593  0% 0% 0% 100%
9,893Java  69.2569.2747,7841282  1% 0% 0% 100%
10,026Haskell GHC #5 70.1870.212,340834  1% 1% 1% 100%
10,050C# Mono 70.3570.3739,428520  0% 1% 1% 100%
10,074Java  #2 70.5270.5439,896514  0% 1% 0% 100%
10,123Scala #2 70.8670.8848,5681017  0% 1% 1% 100%
10,126Haskell GHC #4 70.8870.902,096658  1% 1% 0% 100%
10,649JavaScript V8 #3 74.5474.5711,060539  1% 0% 0% 100%
10,847Lisp SBCL #3 75.9375.9523,696821  1% 0% 1% 100%
11,071Clojure #3 77.5077.5488,2081491  1% 1% 0% 100%
11,242JavaScript V8 #2 78.6978.7214,984472  1% 0% 0% 100%
11,917F# Mono #3 83.4283.4551,688945  0% 0% 1% 100%
12,014Dart #2 84.1084.1340,324495  0% 1% 0% 100%
12,277OCaml #2 85.9485.964,792473  1% 0% 0% 100%
12,468Pascal Free Pascal 87.2887.317521018  1% 0% 0% 100%
12,615C gcc 88.3088.33732508  1% 1% 0% 100%
12,892JavaScript V8 90.2490.2711,076463  0% 1% 0% 100%
13,094Scala 91.6691.6848,484459  0% 0% 1% 100%
13,733C# Mono #3 96.1396.1642,6961096  1% 0% 1% 100%
13,864F# Mono #2 97.0597.0745,708548  0% 1% 1% 100%
13,963OCaml 97.7497.76712524  1% 0% 0% 100%
21,267Clojure #2 148.87148.9777,5281252  1% 1% 1% 100%
22,693F# Mono 158.85159.0649,784551  1% 0% 1% 100%
27,283Lisp SBCL #2 190.98191.2581,520513  0% 1% 1% 100%
35,492Haskell GHC #2 248.45248.543,536808  1% 1% 0% 100%
39,408Racket #2 275.86275.9420,708903  1% 0% 0% 100%
41,307Racket #3 289.15289.2320,9281096  0% 1% 1% 100%
43,418Racket 5 min5 min19,460649  0% 0% 0% 100%
62,871Erlang HiPE 7 min7 min14,7281038  0% 0% 0% 100%
68,097Haskell GHC 7 min7 min3,492553  0% 0% 1% 100%
97,210Ruby JRuby 11 min11 min679,112384  1% 0% 0% 100%
100,595Smalltalk VisualWorks 11 min11 min53,984838  0% 1% 1% 100%
154,733Ruby JRuby #2 18 min18 min682,2241426  0% 1% 1% 100%
176,057Hack 20 min20 min115,600532  1% 1% 1% 100%
255,206Lua 29 min29 min1,008462  1% 1% 1% 100%
282,091Python 3 #4 32 min32 min39,988944  1% 1% 0% 100%
333,646Perl 38 min38 min1,836457  1% 0% 0% 100%
335,716Ruby 39 min39 min7,048384  1% 0% 0% 100%
373,041PHP #2 43 min43 min3,296441  1% 1% 0% 100%
374,110Python 3 #6 43 min43 min5,432385  1% 0% 0% 100%
388,444PHP #3 45 min45 min15,1881150  1% 1% 0% 100%
391,700Hack #2 45 min45 min115,568440  0% 1% 1% 100%
450,065Ruby #2 52 min52 min28,5841426  0% 1% 1% 100%
476,341PHP 55 min55 min3,344482  1% 1% 0% 100%
Haskell GHC #3 Timed Out1h 00 min1153
Hack #3 Failed1150
Perl #2 Failed565
"wrong" (different) algorithm / less comparable programs
5,394C++ g++ #6 37.7637.77720894
5,498C# Mono #4 38.4838.5039,660710
6,075C# Mono #5 42.5242.5443,7081400
6,310Java  #3 44.1744.1933,0881633
7,644Lisp SBCL 53.5153.5343,6281607
280,641Python 3 #3 1964.481.0041,972773

 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