fannkuch-redux benchmark N=12

Each chart bar shows how many times more Code, one ↓ fannkuch-redux program used, compared to the program that used least Code.

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.0Ruby 39 min39 min7,048384  1% 0% 0% 100%
1.0Ruby JRuby 11 min11 min679,112384  1% 0% 0% 100%
1.0Python 3 #6 43 min43 min5,432385  1% 0% 0% 100%
1.1Hack #2 45 min45 min115,568440  0% 1% 1% 100%
1.1PHP #2 43 min43 min3,296441  1% 1% 0% 100%
1.2Perl 38 min38 min1,836457  1% 0% 0% 100%
1.2Scala 91.6691.6848,484459  0% 0% 1% 100%
1.2Lua 29 min29 min1,008462  1% 1% 1% 100%
1.2JavaScript V8 90.2490.2711,076463  0% 1% 0% 100%
1.2JavaScript V8 #2 78.6978.7214,984472  1% 0% 0% 100%
1.2OCaml #2 85.9485.964,792473  1% 0% 0% 100%
1.3PHP 55 min55 min3,344482  1% 1% 0% 100%
1.3Dart #2 84.1084.1340,324495  0% 1% 0% 100%
1.3C gcc 88.3088.33732508  1% 1% 0% 100%
1.3Lisp SBCL #2 190.98191.2581,520513  0% 1% 1% 100%
1.3Java  #2 70.5270.5439,896514  0% 1% 0% 100%
1.4C# Mono 70.3570.3739,428520  0% 1% 1% 100%
1.4OCaml 97.7497.76712524  1% 0% 0% 100%
1.4Hack 20 min20 min115,600532  1% 1% 1% 100%
1.4JavaScript V8 #3 74.5474.5711,060539  1% 0% 0% 100%
1.4F# Mono #2 97.0597.0745,708548  0% 1% 1% 100%
1.4F# Mono 158.85159.0649,784551  1% 0% 1% 100%
1.4Haskell GHC 7 min7 min3,492553  0% 0% 1% 100%
1.5C# Mono #2 46.6046.6139,628564  1% 0% 1% 100%
1.5C gcc #3 54.3454.35820567  0% 1% 0% 100%
1.5Fortran Intel 57.4157.43256590  1% 0% 0% 100%
1.5C++ g++ #3 68.3668.38748593  0% 0% 0% 100%
1.6F# Mono #4 63.6063.6240,688612  0% 0% 1% 100%
1.7Racket 5 min5 min19,460649  0% 0% 0% 100%
1.7Haskell GHC #4 70.8870.902,096658  1% 1% 0% 100%
1.8Lisp SBCL #5 59.3459.3632,872674  1% 1% 0% 100%
2.1Haskell GHC #2 248.45248.543,536808  1% 1% 0% 100%
2.1Lisp SBCL #3 75.9375.9523,696821  1% 0% 1% 100%
2.2Haskell GHC #5 70.1870.212,340834  1% 1% 1% 100%
2.2Smalltalk VisualWorks 11 min11 min53,984838  0% 1% 1% 100%
2.3Go 65.2765.291,024900  0% 0% 1% 100%
2.4Racket #2 275.86275.9420,708903  1% 0% 0% 100%
2.4C gcc #5 35.8435.851,520910  0% 0% 1% 100%
2.5Python 3 #4 32 min32 min39,988944  1% 1% 0% 100%
2.5F# Mono #3 83.4283.4551,688945  0% 0% 1% 100%
2.6OCaml #4 0.0165.8112,0441004  0% 0% 1% 100%
2.6OCaml #3 0.0164.7522,3081017  0% 0% 1% 100%
2.6Scala #2 70.8670.8848,5681017  0% 1% 1% 100%
2.7Pascal Free Pascal 87.2887.317521018  1% 0% 0% 100%
2.7Erlang HiPE 7 min7 min14,7281038  0% 0% 0% 100%
2.8C++ g++ 59.5659.581,6521059  1% 0% 1% 100%
2.9Racket #3 289.15289.2320,9281096  0% 1% 1% 100%
2.9C# Mono #3 96.1396.1642,6961096  1% 0% 1% 100%
3.0Fortran Intel #3 48.8448.857,5201148  1% 1% 0% 100%
3.0C++ g++ #7 22.6222.636641150  1% 0% 0% 100%
3.0PHP #3 45 min45 min15,1881150  1% 1% 0% 100%
3.1C gcc #4 22.6222.638081183  1% 2% 1% 100%
3.1Rust #2 57.5957.618,1761191  1% 1% 0% 100%
3.3Clojure #2 148.87148.9777,5281252  1% 1% 1% 100%
3.3Java  69.2569.2747,7841282  1% 0% 0% 100%
3.7Ruby #2 52 min52 min28,5841426  0% 1% 1% 100%
3.7Ruby JRuby #2 18 min18 min682,2241426  0% 1% 1% 100%
3.7C++ g++ #4 51.8751.891,8041439  1% 0% 0% 100%
3.8C++ g++ #5 52.8752.891,7761440  1% 0% 1% 100%
3.9Clojure #3 77.5077.5488,2081491  1% 1% 0% 100%
4.0Lisp SBCL #4 64.9164.9332,1481518  0% 1% 1% 100%
4.1C gcc #2 54.2854.309681557  0% 1% 1% 100%
5.5Ada 2005 GNAT #3 44.8644.894,0842100  1% 1% 0% 100%
Haskell GHC #3 Timed Out1h 00 min1153
Hack #3 Failed1150
Perl #2 Failed565
"wrong" (different) algorithm / less comparable programs
1.8C# Mono #4 38.4838.5039,660710
2.0Python 3 #3 1964.481.0041,972773
2.3C++ g++ #6 37.7637.77720894
3.6C# Mono #5 42.5242.5443,7081400
4.2Lisp SBCL 53.5153.5343,6281607
4.3Java  #3 44.1744.1933,0881633

 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