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.

    sort sortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0C gcc #5 7.857.85644569  0% 0% 1% 100%
1.0Fortran Intel #3 7.857.861,296638  0% 1% 1% 100%
1.0Fortran Intel #2 7.867.87784513  1% 0% 0% 100%
1.0Fortran Intel 7.867.871,348568  1% 0% 0% 100%
1.0Rust 7.907.914,904898  0% 1% 1% 100%
1.0C++ g++ #6 7.927.939241044  0% 1% 1% 100%
1.0C++ g++ #5 7.927.939241044  1% 1% 1% 100%
1.2Ada 2005 GNAT #4 9.249.261,8802762  0% 1% 1% 100%
1.4C gcc #4 10.6210.636441139  0% 0% 1% 100%
1.7C++ g++ #8 13.4413.446441278  0% 0% 1% 100%
2.0C gcc #3 15.6915.70644463  0% 1% 1% 100%
2.0Go #2 15.7015.711,028668  0% 0% 1% 100%
2.0Go #3 15.7015.711,284536  0% 1% 1% 100%
2.0JavaScript V8 #3 15.7015.7111,176373  1% 0% 1% 100%
2.0JavaScript V8 #2 15.7115.7111,180328  1% 1% 0% 100%
2.0JavaScript V8 15.7115.729,152311  1% 0% 1% 100%
2.0Ada 2005 GNAT #3 15.7015.721,6161702  0% 1% 1% 100%
2.0Pascal Free Pascal 15.7615.768423  0% 0% 0% 100%
2.0Lisp SBCL #2 15.8815.8920,208906  1% 0% 1% 100%
2.0Dart 15.9715.9815,932457  0% 1% 1% 100%
2.0Scala 16.0016.0123,388404  1% 0% 1% 100%
2.0Dart #5 16.0016.0115,660486  1% 0% 0% 100%
2.0Haskell GHC #4 16.0516.061,152984  1% 1% 0% 100%
2.1Java  #2 16.3116.3120,440950  1% 1% 0% 100%
2.1Java  16.4616.4720,168514  0% 1% 1% 100%
2.4OCaml #2 18.8518.861,656377  0% 0% 0% 100%
2.4OCaml #3 17.9718.923,304938  0% 1% 1% 100%
2.6C gcc 20.7320.74364383  1% 0% 1% 100%
2.7Go 20.8020.811,028411  0% 1% 1% 100%
2.8Ada 2005 GNAT 21.7621.761,212710  1% 0% 1% 100%
2.9Racket #3 23.0823.0919,560627  0% 0% 1% 100%
3.0Lisp SBCL #3 23.8623.8717,936883  1% 1% 0% 100%
3.0Lisp SBCL 23.9023.9110,720625  1% 1% 0% 100%
3.6Racket #2 28.2228.2317,912532  0% 0% 1% 100%
3.6C++ g++ 28.4828.49872452  1% 0% 1% 100%
3.8C# Mono 29.4729.4819,476459  0% 1% 0% 100%
4.0C# Mono #2 31.5431.5518,9841063  0% 0% 1% 100%
4.0Racket 31.5631.5816,884446  1% 1% 0% 100%
4.1F# Mono #2 31.3732.1621,972852  0% 1% 1% 98%
4.4Haskell GHC #2 34.9034.913,272403  1% 1% 0% 100%
5.3Clojure #8 41.7841.7948,100918  1% 1% 0% 100%
5.4Clojure #6 42.0242.0448,912808  0% 1% 1% 100%
5.4Clojure #7 42.5642.5849,156762  0% 1% 1% 100%
8.9Erlang HiPE #2 70.1270.1414,244747  1% 0% 0% 100%
14Smalltalk VisualWorks #2 108.94108.9830,980438  1% 1% 1% 100%
15Erlang HiPE 114.62114.6616,248507  1% 0% 0% 100%
26Perl 206.26206.333,720333  1% 1% 1% 100%
35Ruby JRuby #4 273.47273.84644,376326  0% 1% 1% 100%
44Ruby JRuby #2 5 min5 min625,284776  1% 1% 1% 100%
45Lua 5 min5 min1,100329  1% 0% 1% 100%
45Ruby JRuby 5 min5 min625,732292  0% 1% 1% 100%
58PHP #3 7 min7 min14,4361193  1% 1% 0% 100%
62PHP #2 8 min8 min4,672397  0% 0% 1% 100%
75Ruby #4 9 min9 min5,800326  0% 1% 1% 100%
83Ruby 10 min10 min5,664292  0% 1% 0% 100%
90Ruby #3 11 min11 min39,680828  0% 1% 1% 100%
114Perl #3 14 min14 min7,548846  1% 1% 1% 100%
117Perl #2 15 min15 min3,056343  0% 1% 1% 100%
120Python 3 #6 15 min15 min5,004328  0% 1% 0% 100%
131Python 3 #5 17 min17 min30,308437  0% 1% 1% 100%
136Python 3 #8 17 min17 min4,332449  0% 0% 0% 100%
180C CINT 23 min23 min6,180394  0% 0% 0% 100%
Perl #4 Failed551
Scala #2 Failed720
Scala #3 Failed982
Scala #4 Failed1006
"wrong" (different) algorithm / less comparable programs
0.3C gcc #2 2.272.28236,808669
1.0C++ g++ #7 7.987.989241283
1.5Python 3 #2 12.1412.16482,352233
2.1C++ g++ #2 16.3416.346441330
13Python 3 #3 101.22101.71957,344379

 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