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,237C++ g++ #7 22.6622.673601150  1% 1% 0% 100%
3,244C gcc #4 22.7122.723961183  1% 0% 0% 100%
4,939C gcc #5 34.5734.58424910  0% 0% 0% 100%
5,467Ada 2005 GNAT #3 38.2738.301,9602100  1% 0% 1% 100%
6,977Fortran Intel #3 48.8448.857,5201148  1% 1% 0% 100%
6,995C# Mono #2 48.9748.9819,564564  1% 1% 0% 100%
7,490C gcc #3 52.4352.45396567  1% 0% 0% 100%
7,612C++ g++ #5 53.2953.311,2721440  1% 1% 0% 100%
7,650C++ g++ #4 53.5553.571,2721439  1% 1% 1% 100%
7,922C gcc #2 55.4555.474241557  0% 1% 1% 100%
7,969Scala #2 55.7855.8030,9241017  1% 1% 1% 100%
8,201Fortran Intel 57.4157.43256590  1% 0% 0% 100%
8,311Lisp SBCL #5 58.1858.1932,160674  1% 0% 0% 100%
8,437C++ g++ #3 59.0659.08364593  1% 0% 0% 100%
8,504Rust 59.5359.546,9561191  1% 1% 1% 100%
9,017C gcc 63.1263.14392508  1% 0% 1% 100%
9,103F# Mono #4 63.7263.7420,380612  1% 0% 0% 100%
9,325Go 65.2765.291,024900  0% 0% 1% 100%
9,416Lisp SBCL #4 65.9265.9331,6481518  1% 0% 0% 100%
9,981Java  69.8769.8841,3361282  0% 0% 0% 100%
9,983C# Mono 69.8869.9119,304520  1% 0% 1% 100%
10,026Haskell GHC #5 70.1870.212,340834  1% 1% 1% 100%
10,038Clojure #3 70.2670.2978,5961491  1% 1% 0% 100%
10,126Haskell GHC #4 70.8870.902,096658  1% 1% 0% 100%
10,434JavaScript V8 #3 73.0473.066,920539  1% 1% 0% 100%
10,449Java  #2 73.1473.1623,852514  1% 0% 0% 100%
10,541Lisp SBCL #3 73.7973.8023,212821  1% 0% 0% 100%
11,302JavaScript V8 #2 79.1279.146,888472  0% 0% 0% 100%
12,016F# Mono #3 84.1184.1431,048945  0% 1% 1% 100%
12,030Dart #2 84.2184.2534,004495  1% 0% 0% 100%
12,049F# Mono #2 84.3484.3721,228548  1% 0% 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,535C# Mono #3 87.7487.7720,9961096  0% 0% 1% 100%
13,019JavaScript V8 91.1491.166,844463  1% 0% 0% 100%
13,080Scala 91.5691.5925,728459  1% 0% 0% 100%
13,963OCaml 97.7497.76712524  1% 0% 0% 100%
20,590F# Mono 144.13144.2925,140551  0% 1% 1% 100%
22,340Clojure #2 156.38156.4969,2401088  1% 1% 0% 100%
27,501Lisp SBCL #2 192.51192.7678,428513  0% 1% 1% 100%
35,492Haskell GHC #2 248.45248.543,536808  1% 1% 0% 100%
38,858Racket #2 272.01272.0820,224903  0% 0% 1% 100%
42,295Racket #3 296.07296.1420,8041096  0% 1% 1% 100%
42,485Racket 297.40297.4818,820649  0% 0% 1% 100%
65,203Erlang HiPE 7 min7 min13,3281038  1% 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%
144,044Hack 16 min16 min74,064532  0% 0% 0% 100%
154,733Ruby JRuby #2 18 min18 min682,2241426  0% 1% 1% 100%
255,206Lua 29 min29 min1,008462  1% 1% 1% 100%
291,206Python 3 #4 33 min33 min40,008944  1% 2% 2% 100%
305,948Hack #2 35 min35 min74,064440  1% 0% 0% 100%
333,286Python 3 #6 38 min38 min5,416385  1% 0% 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%
388,444PHP #3 45 min45 min15,1881150  1% 1% 0% 100%
450,065Ruby #2 52 min52 min28,5841426  0% 1% 1% 100%
476,341PHP 55 min55 min3,344482  1% 1% 0% 100%
507,372Python 3 #2 59 min59 min40,080797  0% 0% 1% 100%
C++ g++ Failed1059
Haskell GHC #3 Timed Out1h 00 min1153
Hack #3 Failed1150
Perl #2 Failed565
Python 3 Timed Out1h 00 min1108
"wrong" (different) algorithm / less comparable programs
5,409C++ g++ #6 37.8637.88364894
5,749C# Mono #4 40.2440.2621,608710
6,425Java  #3 44.9844.9940,3801633
6,521C# Mono #5 45.6545.6724,9841400
7,480Lisp SBCL 52.3652.3845,2161607
292,779Python 3 #3 2049.452.0042,200773

 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