spectral-norm benchmark N=5,500

Each chart bar shows how many times slower, one ↓ spectral-norm 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.0Fortran Intel #2 7.857.85788513  1% 0% 0% 100%
1.0Rust #3 7.872.065,1121020  95% 96% 96% 96%
1.0Ada 2005 GNAT #4 7.882.011,9282762  99% 99% 99% 99%
1.0C gcc #5 7.891.98752569  99% 99% 100% 100%
1.0Fortran Intel 7.912.011,348568  99% 99% 99% 99%
1.0Fortran Intel #3 7.982.001,328638  100% 100% 100% 100%
1.3C++ g++ #5 10.092.544961044  100% 100% 100% 100%
1.3C++ g++ #6 10.092.544961044  99% 99% 100% 100%
1.4C gcc #4 10.652.684961139  100% 100% 100% 100%
1.4C++ g++ #8 10.682.684961278  100% 100% 100% 100%
2.0OCaml #2 15.6915.701,804377  42% 0% 0% 58%
2.0Rust #2 15.6915.704,896485  1% 0% 0% 100%
2.0Haskell GHC #4 15.704.041,940984  97% 97% 97% 97%
2.0Go #3 15.703.961,816536  99% 99% 99% 99%
2.0Go 15.7115.701,296411  1% 1% 0% 99%
2.0Pascal Free Pascal 15.7115.728423  1% 0% 100% 0%
2.0C gcc #3 15.753.95752463  100% 100% 100% 100%
2.0Go #2 15.774.111,296668  96% 96% 96% 96%
2.0Dart 15.8915.8216,788457  1% 1% 100% 1%
2.0Lisp SBCL #2 15.924.1421,012906  96% 97% 97% 96%
2.0Lisp SBCL #3 15.934.1421,012883  96% 97% 97% 96%
2.1Scala 16.8016.7234,896404  1% 0% 1% 100%
2.1OCaml #3 16.824.783,512938  93% 91% 92% 90%
2.2Ada 2005 GNAT #3 16.914.341,9241702  99% 99% 99% 94%
2.2Java  17.1117.0625,500514  1% 1% 100% 1%
2.2Java  #2 17.604.5525,696950  96% 96% 97% 98%
2.3Clojure #8 18.375.2865,296918  84% 98% 83% 84%
2.4Clojure #6 18.815.5866,268808  83% 80% 80% 95%
2.4Clojure #7 18.945.5966,668762  84% 89% 83% 85%
2.5Rust 19.306.8337,320811  72% 70% 70% 71%
2.6Racket #3 20.665.4126,372627  95% 95% 98% 95%
2.6C gcc 20.6920.70468383  1% 0% 1% 100%
2.6C++ g++ 20.7520.761,072452  1% 0% 100% 1%
2.7Lisp SBCL 20.9220.9312,716625  1% 0% 1% 100%
2.8Ada 2005 GNAT 21.7621.771,492710  1% 1% 100% 0%
2.8C# Mono 21.8621.8720,092459  0% 1% 0% 100%
2.8C# Mono #2 21.955.6424,7641063  98% 98% 97% 97%
2.8F# Mono #2 22.317.3730,580852  73% 76% 75% 80%
4.8Racket #2 37.7937.7923,340532  0% 1% 100% 0%
5.1Racket 40.1640.1619,828446  33% 1% 67% 0%
5.4Haskell GHC #2 42.1620.294,724403  100% 37% 37% 35%
7.1Hack #2 55.5755.5984,712398  0% 1% 100% 0%
7.1Hack #3 55.8514.32162,5121195  97% 97% 97% 99%
9.0Erlang HiPE #2 70.4418.0326,640747  97% 98% 98% 98%
15Erlang HiPE 118.68118.7233,604507  100% 0% 1% 1%
19Erlang #2 152.1838.5620,576747  98% 98% 99% 100%
23Perl #4 183.4747.039,340551  98% 97% 98% 97%
26Perl 200.90200.975,516333  0% 0% 0% 100%
27Erlang 213.78213.9225,948507  1% 17% 0% 83%
32Ruby JRuby #4 250.63243.93673,640326  21% 24% 31% 28%
34Ruby JRuby 270.52263.40673,976292  27% 27% 20% 31%
40Ruby #4 5 min5 min8,968326  0% 1% 100% 1%
50Ruby #3 6 min102.2041,320828  96% 96% 95% 95%
52Ruby 6 min6 min8,964292  1% 0% 0% 100%
57PHP #2 7 min7 min7,244397  96% 0% 5% 0%
57PHP #3 7 min113.8524,4081193  98% 97% 100% 98%
97Python 3 #6 12 min12 min6,464328  1% 0% 0% 100%
105Python 3 #5 13 min209.7643,728437  98% 98% 98% 98%
118Python 3 #8 15 min15 min5,600449  0% 1% 100% 0%
119Perl #2 15 min15 min3,972343  85% 15% 0% 0%
120Perl #3 15 min235.3610,404846  100% 100% 100% 100%
126Ruby JRuby #2 16 min253.95675,568776  98% 98% 98% 98%
Scala #4 Failed1006
Scala #3 Failed982
Scala #2 Failed720
"wrong" (different) algorithm / less comparable programs
0.3C gcc #2 2.332.34236,904669
1.0C++ g++ #2 7.921.994961330
1.1C++ g++ #7 8.492.144921283
1.4Python 3 #2 11.0111.02489,356233
12Python 3 #3 96.4397.021,197,752379

 spectral-norm benchmark : Eigenvalue using the power method

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 = 100 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.

Each program should calculate the spectral norm of an infinite matrix A, with entries a11=1, a12=1/2, a21=1/3, a13=1/4, a22=1/5, a31=1/6, etc

Each program must implement 4 separate functions / procedures / methods like the C# program.

For more information see challenge #3 in Eric W. Weisstein, "Hundred-Dollar, Hundred-Digit Challenge Problems" and "Spectral Norm".

From MathWorld--A Wolfram Web Resource.
http://mathworld.wolfram.com/Hundred-DollarHundred-DigitChallengeProblems.html
http://mathworld.wolfram.com/SpectralNorm.html

Thanks to Sebastien Loisel for this benchmark.

Revised BSD license

  Home   Conclusions   License   Play