spectral-norm benchmark N=5,500

Each chart bar shows how many times more Code, one ↓ spectral-norm 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 10 min10 min6,712292  0% 1% 24% 77%
1.0Ruby JRuby 6 min6 min646,316292  31% 20% 21% 32%
1.1Ruby JRuby #4 290.28282.22647,796326  26% 36% 18% 24%
1.1Ruby #4 9 min9 min5,812326  1% 0% 65% 36%
1.1Python 3 #6 15 min15 min4,980328  97% 1% 4% 0%
1.1Perl 226.90226.983,936333  1% 1% 0% 100%
1.2Perl #2 17 min17 min3,088343  1% 0% 100% 1%
1.3OCaml #2 18.8518.861,656377  0% 1% 1% 100%
1.3C gcc 20.7320.74364383  0% 100% 1% 1%
1.4PHP #2 7 min7 min4,688397  0% 100% 1% 1%
1.4Haskell GHC #2 112.1837.849,880403  66% 65% 100% 66%
1.4Scala 16.0515.9721,408404  1% 1% 99% 2%
1.4Go 20.8020.801,024411  1% 0% 100% 1%
1.4Pascal Free Pascal 15.7615.778423  1% 1% 0% 100%
1.5Python 3 #5 16 min252.9230,320437  99% 100% 99% 99%
1.5Racket 31.2831.2721,136446  0% 0% 1% 100%
1.5C++ g++ 28.4628.48872452  0% 100% 1% 1%
1.6Dart 16.1315.9619,500457  1% 1% 1% 100%
1.6C# Mono 29.4729.4819,476459  1% 1% 0% 100%
1.6C gcc #3 15.743.95644463  100% 100% 100% 100%
1.7Dart #5 16.1115.9419,768486  100% 2% 1% 1%
1.7Erlang HiPE 114.35114.3831,488507  0% 100% 0% 1%
1.8Fortran Intel #2 7.867.87784513  0% 2% 100% 0%
1.8Java  16.4816.4123,812514  1% 100% 1% 0%
1.8Racket #2 28.5028.4919,344532  0% 0% 1% 100%
1.8Go #3 15.703.951,024536  99% 99% 99% 100%
1.9Perl #4 211.8054.416,644551  97% 98% 96% 98%
1.9Fortran Intel 7.921.995,440568  99% 100% 100% 100%
1.9C gcc #5 7.901.99644569  100% 100% 100% 100%
2.1Lisp SBCL 23.3923.4010,176625  0% 0% 100% 0%
2.1Racket #3 22.945.9921,612627  96% 95% 95% 97%
2.2Fortran Intel #3 7.911.995,384638  100% 99% 100% 100%
2.3Go #2 15.814.161,096668  96% 95% 96% 94%
2.4Ada 2005 GNAT 21.7621.761,212710  1% 0% 1% 100%
2.5F# Mono #3 17.976.3122,724720  68% 72% 70% 76%
2.6Erlang HiPE #2 71.4518.1920,904747  98% 98% 98% 99%
2.6Clojure #7 42.8811.5849,756762  92% 95% 93% 91%
2.7Ruby JRuby #2 20 min5 min651,988776  99% 98% 98% 98%
2.8Clojure #6 42.3811.4649,636808  90% 97% 92% 91%
2.8Ruby #3 10 min168.1425,624828  96% 97% 97% 97%
2.9Perl #3 17 min267.098,192846  100% 99% 99% 100%
2.9F# Mono #2 31.489.6821,972852  78% 82% 83% 83%
3.0Lisp SBCL #3 23.936.1720,072883  97% 97% 97% 97%
3.1Lisp SBCL #2 15.944.1317,772906  96% 97% 97% 97%
3.1Clojure #8 42.1611.2549,204918  92% 92% 94% 97%
3.2OCaml #3 18.145.103,192938  93% 93% 95% 93%
3.3Java  #2 16.564.3020,064950  95% 96% 99% 96%
3.4Haskell GHC #4 16.084.151,392984  95% 97% 99% 97%
3.6C++ g++ #5 7.972.009241044  100% 100% 100% 100%
3.6C++ g++ #6 7.972.019241044  100% 100% 100% 100%
3.6C# Mono #2 31.608.0919,0361063  98% 97% 98% 98%
3.9C gcc #4 10.672.683801139  100% 100% 100% 100%
4.1PHP #3 7 min110.1814,1361193  99% 99% 100% 99%
4.4C++ g++ #8 13.533.406441278  100% 100% 100% 100%
5.8Ada 2005 GNAT #3 15.723.981,6161702  99% 99% 99% 99%
9.5Ada 2005 GNAT #4 9.402.401,8802762  99% 98% 97% 98%
Rust Make Error898
Scala #2 Failed720
Scala #3 Failed982
Scala #4 Failed1006
"wrong" (different) algorithm / less comparable programs
0.8Python 3 #2 8.528.53479,784233
1.3Python 3 #3 75.4975.59957,216379
2.3C gcc #2 2.282.28236,808669
4.4C++ g++ #7 8.072.039241283
4.6C++ g++ #2 16.644.196401330

 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