spectral-norm benchmark N=5,500

Each chart bar shows how many times more Memory, one ↓ spectral-norm program used, compared to the program that used least Memory.

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.

    sortsort sort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0Pascal Free Pascal 15.7115.728423  1% 0% 100% 0%
59C gcc 20.6920.70468383  1% 0% 1% 100%
62C++ g++ #5 10.092.544961044  100% 100% 100% 100%
62C++ g++ #8 10.682.684961278  100% 100% 100% 100%
62C gcc #4 10.652.684961139  100% 100% 100% 100%
62C++ g++ #6 10.092.544961044  99% 99% 100% 100%
94C gcc #5 7.891.98752569  99% 99% 100% 100%
94C gcc #3 15.753.95752463  100% 100% 100% 100%
99Fortran Intel #2 7.857.85788513  1% 0% 0% 100%
134C++ g++ 20.7520.761,072452  1% 0% 100% 1%
162Go 15.7115.701,296411  1% 1% 0% 99%
162Go #2 15.774.111,296668  96% 96% 96% 96%
166Fortran Intel #3 7.982.001,328638  100% 100% 100% 100%
169Fortran Intel 7.912.011,348568  99% 99% 99% 99%
187Ada 2005 GNAT 21.7621.771,492710  1% 1% 100% 0%
226OCaml #2 15.6915.701,804377  42% 0% 0% 58%
227Go #3 15.703.961,816536  99% 99% 99% 99%
241Ada 2005 GNAT #3 16.914.341,9241702  99% 99% 99% 94%
241Ada 2005 GNAT #4 7.882.011,9282762  99% 99% 99% 99%
243Haskell GHC #4 15.704.041,940984  97% 97% 97% 97%
439OCaml #3 16.824.783,512938  93% 91% 92% 90%
497Perl #2 15 min15 min3,972343  85% 15% 0% 0%
591Haskell GHC #2 42.1620.294,724403  100% 37% 37% 35%
612Rust #2 15.6915.704,896485  1% 0% 0% 100%
639Rust #3 7.872.065,1121020  95% 96% 96% 96%
690Perl 200.90200.975,516333  0% 0% 0% 100%
700Python 3 #8 15 min15 min5,600449  0% 1% 100% 0%
808Python 3 #6 12 min12 min6,464328  1% 0% 0% 100%
906PHP #2 7 min7 min7,244397  96% 0% 5% 0%
1,122Ruby 6 min6 min8,972292  1% 100% 0% 0%
1,168Perl #4 183.4747.039,340551  98% 97% 98% 97%
1,182Ruby #4 5 min5 min9,452326  1% 100% 0% 0%
1,301Perl #3 15 min235.3610,404846  100% 100% 100% 100%
1,594Lisp SBCL 21.2821.2912,752625  0% 1% 100% 0%
2,097Erlang #2 145.6136.7816,772747  99% 99% 99% 99%
2,240Erlang HiPE 56.7756.7817,920507  75% 25% 0% 0%
2,257Dart 22.0721.9318,056457  1% 1% 1% 100%
2,479Racket 40.1640.1619,828446  33% 1% 67% 0%
2,492Erlang 222.95223.0319,936507  90% 10% 0% 0%
2,512C# Mono 21.8621.8720,092459  0% 1% 0% 100%
2,614Java  17.1217.0620,908514  99% 1% 1% 1%
2,642Java  #2 17.804.5921,132950  97% 96% 99% 96%
2,855Erlang HiPE #2 47.4812.0922,836747  99% 98% 98% 98%
2,898Lisp SBCL #2 15.914.1223,184906  96% 97% 97% 97%
2,898Lisp SBCL #3 15.914.1323,184883  97% 97% 96% 97%
2,901Scala 17.5917.5123,204404  1% 0% 1% 100%
2,918Racket #2 37.7937.7923,340532  0% 1% 100% 0%
3,051PHP #3 7 min113.8524,4081193  98% 97% 100% 98%
3,096C# Mono #2 21.955.6424,7641063  98% 98% 97% 97%
3,178Scala #2 17.814.6325,420720  100% 95% 95% 95%
3,297Racket #3 20.665.4126,372627  95% 95% 98% 95%
3,823F# Mono #2 22.317.3730,580852  73% 76% 75% 80%
4,665Rust 19.306.8337,320811  72% 70% 70% 71%
5,337Ruby #3 6 min98.7042,696828  96% 96% 97% 97%
5,466Python 3 #5 13 min209.7643,728437  98% 98% 98% 98%
7,616Clojure #7 18.785.5860,924762  82% 81% 82% 93%
8,048Clojure #6 18.765.5364,384808  83% 81% 81% 95%
8,120Clojure #8 18.305.2564,960918  84% 83% 98% 85%
10,589Hack #2 55.5755.5984,712398  0% 1% 100% 0%
20,314Hack #3 55.8514.32162,5121195  97% 97% 97% 99%
82,111Ruby JRuby 270.56263.82656,884292  34% 22% 18% 31%
82,624Ruby JRuby #4 251.58245.32660,988326  29% 35% 17% 24%
83,506Ruby JRuby #2 16 min250.73668,044776  98% 98% 98% 98%
Scala #4 Failed1006
Scala #3 Failed982
"wrong" (different) algorithm / less comparable programs
62C++ g++ #7 8.492.144921283
62C++ g++ #2 7.921.994961330
29,613C gcc #2 2.332.34236,904669
61,170Python 3 #2 11.0111.02489,356233
149,719Python 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