/mobile Handheld Friendly website

 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 min7,920292  0% 0% 0% 100%
1.0Ruby JRuby 6 min6 min626,968292  23% 22% 23% 35%
1.1Ruby JRuby #4 297.72292.36605,212326  18% 38% 33% 15%
1.1Ruby #4 12 min12 min5,436326  99% 0% 0% 1%
1.1Python 3 #6 15 min15 min5,012328  0% 9% 91% 1%
1.1Perl 229.81229.893,860333  96% 0% 0% 4%
1.2Perl #2 17 min17 min3,076343  99% 0% 0% 1%
1.3OCaml #2 18.8518.861,660377  1% 0% 0% 100%
1.3C gcc 20.7320.74372383  0% 1% 100% 0%
1.4PHP #2 6 min6 min4,688397  0% 0% 1% 100%
1.4Haskell GHC #2 106.4836.423,784403  63% 65% 65% 100%
1.4Scala 16.0415.9718,536404  99% 1% 0% 2%
1.4Go 15.7715.771,460411  0% 100% 1% 1%
1.4Pascal Free Pascal 15.7715.778423  0% 100% 1% 1%
1.5Python 3 #5 17 min258.4230,260437  99% 99% 99% 99%
1.5Racket 31.1431.1316,892446  0% 1% 100% 0%
1.5Python 3 #8 17 min17 min4,336449  0% 0% 1% 100%
1.5C++ g++ 28.5628.57884452  0% 1% 100% 1%
1.6Dart 23.0822.9829,768457  0% 1% 100% 1%
1.6C# Mono 30.9630.9815,168459  1% 0% 0% 100%
1.6C gcc #3 15.743.95652463  100% 100% 100% 100%
1.7Erlang HiPE 56.6856.6914,912507  100% 0% 0% 0%
1.8Fortran Intel #2 7.857.86780513  1% 1% 2% 100%
1.8Java  16.5016.4416,968514  0% 1% 100% 0%
1.8Racket #2 28.1728.1717,904532  0% 0% 9% 92%
1.8Go #3 20.765.211,448536  100% 100% 100% 100%
1.9Perl #4 212.5754.356,780551  97% 98% 98% 99%
1.9Fortran Intel 7.932.001,316568  99% 99% 100% 99%
1.9C gcc #5 7.871.98652569  99% 100% 99% 99%
2.1Lisp SBCL 24.4124.425,636625  1% 0% 0% 100%
2.1Racket #3 22.946.0019,540627  95% 95% 98% 95%
2.2Fortran Intel #3 7.912.001,296638  99% 99% 99% 99%
2.3Go #2 20.835.39976668  97% 97% 96% 96%
2.4Ada 2005 GNAT 21.7621.771,236710  0% 1% 100% 0%
2.5Scala #2 16.614.3519,928720  94% 95% 99% 94%
2.6Erlang HiPE #2 45.0111.5114,436747  99% 98% 98% 98%
2.6Clojure #7 42.7611.5646,568762  91% 95% 94% 90%
2.7Ruby JRuby #2 12 min197.76611,560776  98% 98% 98% 98%
2.8Clojure #6 42.3111.4645,320808  97% 90% 91% 91%
2.8Ruby #3 10 min166.2926,908828  97% 97% 97% 97%
2.9Rust 37.2912.831,732835  74% 73% 72% 73%
2.9Perl #3 17 min269.367,976846  100% 99% 99% 100%
2.9F# Mono #2 29.769.1417,572852  79% 80% 86% 81%
3.0Lisp SBCL #3 22.555.754,568883  98% 98% 98% 98%
3.1Lisp SBCL #2 15.744.034,560906  98% 98% 98% 98%
3.2OCaml #3 18.245.273,232938  87% 97% 95% 85%
3.3Java  #2 16.564.2916,460950  96% 96% 99% 96%
3.4Haskell GHC #4 15.704.041,420984  97% 97% 97% 98%
3.6C++ g++ #6 7.962.009361044  100% 100% 100% 100%
3.6C++ g++ #5 7.962.009361044  100% 100% 100% 100%
3.6C# Mono #2 29.507.4914,6361063  99% 99% 99% 99%
3.9C gcc #4 10.652.673921139  100% 100% 100% 100%
4.1PHP #3 7 min108.8614,3721193  99% 99% 99% 99%
4.4C++ g++ #8 13.283.336521278  100% 100% 100% 100%
5.8Ada 2005 GNAT #3 15.724.031,6401702  98% 98% 98% 98%
9.5Ada 2005 GNAT #4 9.402.401,9042762  98% 98% 99% 98%
Scala #3 Failed982
Scala #4 Failed1006
"wrong" (different) algorithm / less comparable programs
0.8Python 3 #2 12.1512.16479,764233
1.3Python 3 #3 101.30101.81957,348379
2.3C gcc #2 4.004.00236,912669
4.4C++ g++ #7 8.062.039361283
4.6C++ g++ #2 16.564.159361330

 spectral-norm benchmark : Eigenvalue using the power method

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