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 #5 35.659.101,516910  99% 96% 97% 100%
1.2Ada 2005 GNAT #3 44.8311.274,1002100  100% 100% 99% 100%
1.5C++ g++ #4 51.9113.281,7841439  94% 99% 100% 98%
1.5Rust #2 53.1813.458,1161191  100% 96% 100% 100%
1.5C++ g++ #5 52.8413.511,8041440  100% 99% 93% 100%
1.5C gcc #2 54.4913.948801557  95% 99% 99% 99%
1.5Fortran Intel #3 55.7413.9810,5361148  100% 100% 100% 100%
1.7C++ g++ 59.5515.213,6961059  100% 94% 98% 100%
1.7Scala #2 59.6215.2336,8201017  99% 98% 98% 97%
1.8OCaml #3 0.0116.2522,3081017  100% 100% 100% 100%
1.8Go 65.1216.381,788900  100% 99% 99% 100%
1.8OCaml #4 0.0116.4912,1601004  100% 100% 100% 100%
1.8Lisp SBCL #4 64.9416.7332,1481518  99% 100% 98% 92%
1.9Haskell GHC #5 68.2317.368,080834  100% 99% 99% 96%
1.9Java  68.6417.4133,0321282  98% 98% 99% 99%
2.2Clojure #3 76.7420.0574,4761491  96% 99% 94% 94%
2.4Pascal Free Pascal 87.2821.877521018  100% 100% 100% 100%
2.4C# Mono #3 86.5522.1241,3681096  97% 99% 97% 99%
2.5F# Mono #3 84.5022.4652,492945  94% 94% 94% 94%
2.5C++ g++ #7 22.6122.627321150  100% 1% 0% 0%
2.5C gcc #4 22.6422.657521183  100% 0% 1% 1%
5.3C# Mono #2 48.6048.6239,464564  100% 0% 0% 1%
6.0C gcc #3 54.3454.36800567  0% 0% 1% 100%
6.3Fortran Intel 57.5957.61516590  1% 0% 1% 100%
6.5Lisp SBCL #5 59.3559.3732,868674  1% 1% 0% 100%
6.7Clojure #2 187.9160.8191,2761252  79% 78% 76% 75%
7.1F# Mono #4 64.4164.4340,788612  0% 0% 100% 1%
7.5C++ g++ #3 68.3068.32720593  0% 0% 100% 1%
7.8Java  #2 70.7670.7243,452514  1% 1% 0% 99%
7.8Haskell GHC #4 76.6870.906,288658  86% 17% 3% 3%
7.8C# Mono 71.1371.1539,172520  1% 0% 0% 100%
8.1Lisp SBCL #3 74.0974.1123,696821  1% 100% 0% 0%
9.4OCaml #2 85.9485.962,740473  1% 0% 0% 100%
9.4Racket #3 5 min85.9626,5761096  86% 84% 86% 99%
9.7C gcc 88.3088.32816508  0% 0% 100% 1%
9.7Dart #2 88.9788.5535,976495  90% 0% 0% 11%
10Scala 92.2492.2147,188459  1% 100% 1% 1%
11F# Mono #2 97.0297.0446,672548  1% 100% 0% 0%
11OCaml 97.7297.74708524  1% 0% 100% 0%
13Erlang HiPE 7 min119.2920,3401038  100% 99% 98% 99%
17F# Mono 153.33153.5446,688551  20% 81% 1% 1%
18Haskell GHC #2 8 min165.247,740808  81% 81% 80% 81%
21Lisp SBCL #2 190.77191.0481,520513  1% 1% 0% 100%
22Erlang 12 min199.7121,2921038  99% 97% 94% 100%
31Racket #2 278.63278.6220,164903  1% 22% 39% 41%
33Racket 5 min5 min20,504649  1% 0% 0% 100%
39Ruby JRuby #2 21 min5 min684,4681426  90% 92% 99% 82%
56Python 3 #4 33 min8 min39,992944  99% 97% 100% 97%
60Haskell GHC 12 min9 min8,636553  39% 43% 26% 35%
63Perl #2 38 min9 min10,976565  100% 99% 100% 99%
69Ruby JRuby 10 min10 min675,384384  11% 30% 47% 15%
73PHP #3 44 min11 min15,1881150  100% 100% 100% 100%
88Ruby #2 51 min13 min28,5321426  97% 97% 98% 98%
130Hack 19 min19 min113,336532  100% 0% 0% 1%
261Python 3 #6 39 min39 min5,432385  95% 0% 0% 6%
276Ruby 41 min41 min7,260384  91% 9% 0% 2%
281Perl 42 min42 min1,872457  5% 18% 0% 78%
288PHP #2 43 min43 min3,304441  1% 38% 0% 62%
302Hack #2 45 min45 min113,568440  32% 35% 3% 31%
353PHP 53 min53 min3,344482  1% 0% 0% 100%
Haskell GHC #3 Timed Out1h 00 min1153
Hack #3 Failed1150
"wrong" (different) algorithm / less comparable programs
1.2Java  #3 41.5010.5633,4081633
1.2C# Mono #5 42.5411.0144,5121400
1.5Lisp SBCL 53.4513.5443,6281607
4.1C++ g++ #6 37.7637.77752894
4.3C# Mono #4 39.3839.3839,448710
54Python 3 #3 1940.66490.6039,868773

 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