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.

    sort sortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0C gcc #4 24.3224.336601183  1% 0% 1% 100%
1.0C++ g++ #7 24.4524.465841150  1% 0% 1% 100%
1.6C gcc #5 39.4439.451,384910  1% 0% 0% 100%
2.0C gcc #3 48.2648.28664567  1% 0% 0% 100%
2.0Rust #2 49.2549.278,0921191  1% 0% 0% 100%
2.0C# Mono #2 49.2649.2837,616564  1% 0% 0% 100%
2.1Ada 2005 GNAT #3 50.4450.473,9282100  1% 0% 1% 100%
2.1C++ g++ #4 50.8250.841,4041439  0% 0% 1% 100%
2.1C++ g++ #5 51.0051.021,4121440  1% 1% 0% 100%
2.2C gcc #2 52.7852.807321557  1% 0% 0% 100%
2.3Haskell GHC #3 56.5456.561,9401153  1% 0% 0% 100%
2.4C++ g++ #3 57.2857.29624593  1% 0% 0% 100%
2.4Scala #2 58.7858.8129,8161017  2% 1% 1% 100%
2.5Lisp SBCL #4 61.5861.5925,4961518  0% 1% 1% 100%
2.6Lisp SBCL #5 62.3662.3821,860674  0% 0% 0% 100%
2.8Pascal Free Pascal 67.5467.576921018  1% 1% 0% 100%
2.8Java  67.6367.6626,6441282  1% 1% 0% 100%
2.8Fortran Intel #3 67.9167.937,4561148  1% 0% 1% 100%
2.8Lisp SBCL #3 68.6868.7017,068821  1% 1% 1% 100%
2.8Fortran Intel 69.3069.32260590  0% 1% 1% 100%
2.9F# Mono #4 70.1070.1339,084612  1% 1% 0% 100%
2.9JavaScript V8 #3 71.3671.3910,572539  1% 0% 0% 100%
3.0Java  #2 73.7873.8124,652514  1% 0% 0% 100%
3.0C gcc 73.8773.90656508  1% 0% 0% 100%
3.1Dart #2 76.3676.3823,052495  0% 0% 0% 100%
3.3Haskell GHC #5 81.2081.231,936834  1% 0% 0% 100%
3.3JavaScript V8 #2 81.2881.3010,536472  1% 1% 0% 100%
3.4Haskell GHC #4 82.2182.231,680658  1% 0% 0% 100%
3.4OCaml #2 83.3483.36604473  0% 1% 1% 100%
3.5C# Mono 84.3984.4137,420520  1% 0% 0% 100%
3.6JavaScript V8 87.6887.7110,556463  1% 1% 1% 100%
3.8Go 92.1692.201,720900  1% 1% 0% 100%
4.2F# Mono #2 101.66101.6943,456548  0% 0% 1% 100%
4.3Scala 105.41105.4528,932459  2% 0% 1% 100%
4.4OCaml #3 0.00107.8218,9481017  0% 1% 1% 100%
4.9C# Mono #3 120.28120.3137,8081096  1% 1% 0% 100%
5.0F# Mono #3 121.43121.5645,924945  0% 1% 0% 100%
5.5OCaml #4 0.00134.019,4281004  0% 0% 1% 100%
6.1Clojure #3 148.31148.3657,4321491  1% 0% 0% 100%
6.3OCaml 153.72153.75600524  1% 1% 0% 100%
6.5Lisp SBCL #2 159.16159.2441,088513  0% 1% 1% 100%
7.1F# Mono 172.60172.7745,332551  0% 0% 1% 100%
9.8Clojure #2 238.06238.1861,1801252  1% 0% 0% 100%
10Haskell GHC #2 253.66253.743,248808  1% 1% 0% 100%
12Racket #2 5 min5 min18,376903  0% 1% 0% 100%
13Racket 5 min5 min17,132649  1% 1% 0% 100%
13Racket #3 5 min5 min19,7961096  1% 1% 1% 100%
16Erlang HiPE 6 min6 min11,4081038  1% 0% 0% 100%
18Haskell GHC 7 min7 min3,268553  1% 0% 0% 100%
25Smalltalk VisualWorks 10 min10 min24,332838  3% 5% 2% 100%
46Ruby JRuby 18 min18 min274,216384  0% 1% 1% 100%
101Python 3 #4 41 min41 min28,000944  1% 1% 0% 100%
102PHP #3 41 min41 min11,0081150  1% 1% 0% 100%
103Perl 41 min41 min1,468457  0% 1% 1% 100%
105PHP #2 42 min42 min2,548441  0% 0% 1% 100%
107Lua 43 min43 min820462  1% 0% 1% 100%
112Ruby 45 min45 min5,036384  0% 0% 1% 100%
120Ruby JRuby #2 48 min48 min288,8041426  0% 1% 1% 100%
121Python 3 #6 48 min48 min4,168385  0% 0% 1% 100%
130PHP 52 min52 min2,584482  0% 0% 1% 100%
439C 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
1.5C++ g++ #6 36.2536.27588894
1.9Java  #3 46.2746.2925,5881633
2.2Lisp SBCL 53.4353.4432,3641607
3.9C# Mono #4 94.0494.0737,588710
5.3C# Mono #5 128.20128.2440,3801400
95Python 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