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.0133.609,4281004  100% 100% 100% 100%
1.0OCaml #3 0.0127.0818,9601017  100% 100% 100% 100%
3,408C gcc #4 27.2627.273161183  0% 0% 1% 100%
3,409C++ g++ #7 27.2727.282841150  0% 100% 0% 1%
4,783C gcc #5 38.269.75340910  100% 99% 99% 95%
4,912Ada 2005 GNAT #3 39.299.871,6562100  100% 100% 100% 100%
5,997C gcc #3 47.9847.99316567  0% 100% 1% 1%
6,254C++ g++ #5 50.0312.881,0361440  99% 99% 100% 99%
6,507Rust 52.0613.2910,9321191  99% 98% 100% 95%
6,560C++ g++ #4 52.4813.371,0361439  100% 100% 99% 95%
6,795Haskell GHC #3 54.3613.893,4241153  98% 98% 100% 95%
6,847C gcc #2 54.7714.243441557  91% 98% 100% 96%
7,235C gcc 57.8857.90316508  0% 100% 1% 1%
7,239C++ g++ #3 57.9157.93284593  1% 0% 0% 100%
7,372Lisp SBCL #5 58.9858.9922,576674  1% 1% 100% 1%
7,546Scala #2 60.3615.4223,1041017  98% 97% 98% 98%
7,950Lisp SBCL #4 63.6016.3226,1881518  100% 99% 98% 93%
8,048Java  64.3816.3319,9081282  98% 100% 98% 99%
8,061C# Mono #2 64.4964.5118,616564  1% 0% 100% 0%
8,302Fortran Intel 66.4266.43520590  0% 1% 1% 100%
8,442Pascal Free Pascal 67.5416.936961018  100% 100% 100% 100%
8,925Lisp SBCL #3 71.4071.4117,736821  1% 0% 0% 100%
9,011F# Mono #4 72.0872.1119,124612  0% 1% 100% 1%
9,397Fortran Intel #3 75.1818.8512,4641148  100% 100% 100% 100%
9,420Java  #2 75.3675.3220,052514  1% 1% 100% 0%
9,575Dart #2 76.6076.0120,856495  0% 2% 2% 100%
10,031Haskell GHC #5 80.2520.473,712834  98% 99% 95% 100%
10,418OCaml #2 83.3483.36604473  0% 1% 1% 100%
11,102C# Mono 88.8288.8418,624520  0% 100% 1% 0%
11,171Haskell GHC #4 89.3686.6210,088658  2% 1% 1% 100%
12,500Scala 100.0099.9422,296459  1% 99% 0% 1%
12,772F# Mono #2 102.17102.2020,968548  0% 100% 0% 1%
12,898Go 103.1825.97760900  99% 99% 100% 100%
14,372C# Mono #3 114.9829.2819,7881096  99% 99% 98% 98%
15,631F# Mono #3 125.0432.7623,212945  93% 98% 95% 97%
18,074Clojure #3 144.5937.0253,3361491  97% 98% 99% 97%
19,315OCaml 154.52154.55604524  1% 1% 1% 100%
21,037F# Mono 168.29168.2423,536551  1% 51% 50% 1%
22,822Lisp SBCL #2 182.57182.6943,728513  0% 1% 1% 100%
32,350Clojure #2 258.8076.9156,9041088  85% 85% 83% 83%
38,022Racket #2 5 min5 min16,876903  0% 0% 30% 70%
39,223Racket 5 min5 min15,364649  0% 1% 41% 60%
41,582Racket #3 5 min83.7717,1601096  99% 100% 99% 100%
50,691Erlang HiPE 6 min102.5312,9441038  100% 98% 98% 100%
53,892Haskell GHC #2 7 min143.655,020808  75% 76% 75% 75%
80,869Haskell GHC 10 min8 min9,592553  25% 44% 18% 42%
297,619Perl #2 39 min9 min12,380565  100% 100% 99% 99%
306,808PHP #2 40 min40 min2,556441  99% 1% 1% 2%
308,838Python 3 #4 41 min10 min27,972944  99% 98% 99% 98%
313,284PHP #3 41 min10 min10,5161150  100% 99% 99% 100%
327,997Python 3 #6 43 min43 min4,200385  0% 0% 1% 100%
351,531Ruby JRuby #2 46 min13 min784,8201426  95% 89% 88% 90%
352,100Perl 46 min46 min1,768457  21% 0% 79% 1%
352,960Ruby 47 min47 min5,172384  97% 1% 4% 0%
382,291Ruby JRuby 50 min50 min658,916384  32% 20% 19% 32%
397,518PHP 53 min53 min2,588482  0% 1% 1% 100%
500,007Python 3 #2 1h 06 min16 min27,840797  99% 99% 98% 100%
548,913Python 3 1h 13 min18 min27,8881108  100% 99% 99% 98%
549,963Ruby #2 1h 13 min18 min18,5281426  98% 96% 100% 97%
C++ g++ Failed1059
"wrong" (different) algorithm / less comparable programs
4,563C++ g++ #6 36.5036.52284894
5,787Java  #3 46.2911.7622,5801633
6,665Lisp SBCL 53.3213.4833,3401607
10,770C# Mono #4 86.1686.1718,884710
14,198C# Mono #5 113.5828.8921,0721400
306,827Python 3 #3 2454.61623.5531,936773

 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