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.0Fortran Intel #3 7.901.983,392638  99% 100% 99% 100%
1.0Fortran Intel 7.911.993,716568  99% 100% 100% 99%
1.0C++ g++ #8 7.881.991,7561278  99% 99% 100% 99%
1.0C++ g++ #5 7.962.005,7881044  100% 100% 100% 100%
1.0C++ g++ #6 7.962.001,7521044  100% 100% 100% 100%
1.0Ada 2005 GNAT #4 7.872.004,2242762  99% 99% 99% 98%
1.1C gcc #5 8.282.091,776569  100% 100% 100% 99%
1.1C gcc #4 8.532.151,7481139  100% 100% 100% 100%
2.0C gcc #3 15.743.951,740463  100% 100% 100% 100%
2.0Go #3 15.703.952,892536  100% 99% 99% 99%
2.0Rust #2 15.703.966,1041265  99% 99% 99% 99%
2.0Ada 2005 GNAT #3 15.703.974,0881702  99% 99% 99% 100%
2.0Haskell GHC #4 15.704.055,788984  95% 97% 99% 97%
2.1Go #2 15.724.102,112668  96% 95% 96% 97%
2.1Lisp SBCL #2 15.974.1820,972906  96% 95% 96% 96%
2.1Lisp SBCL #3 15.984.1921,052883  96% 96% 95% 96%
2.2Java  #2 16.534.2832,696950  96% 96% 96% 99%
2.2OCaml #3 16.024.313,496938  93% 94% 93% 92%
2.2Scala #5 16.564.4138,900693  94% 93% 92% 97%
2.7Clojure #8 18.565.3772,172918  93% 86% 86% 82%
2.8Clojure #7 18.665.5169,264762  82% 88% 83% 88%
2.8Clojure #6 18.655.5370,372808  86% 84% 82% 87%
2.8F# Mono #3 18.635.6151,728720  81% 84% 80% 88%
2.9C# Mono #2 22.045.7342,2761063  96% 96% 98% 96%
3.0Racket #3 23.096.0433,396627  95% 95% 98% 95%
3.2F# Mono #2 22.676.4052,544852  86% 88% 92% 89%
4.0Fortran Intel #2 7.857.85776513  0% 1% 100% 0%
7.8Hack #3 54.8215.57117,6441195  86% 93% 87% 88%
7.9OCaml #2 15.6915.693,276377  1% 1% 100% 0%
7.9Ada 2005 GNAT 15.6915.691,988710  0% 0% 100% 1%
7.9Go 15.7015.702,904411  100% 0% 1% 1%
7.9C++ g++ 15.7015.711,520452  100% 1% 1% 0%
7.9Pascal Free Pascal 15.7115.728423  1% 0% 100% 0%
8.0Dart #5 16.0015.8826,516518  1% 1% 99% 1%
8.0Scala 16.0315.9633,840404  3% 20% 1% 100%
8.1C gcc 16.1316.141,032383  0% 100% 1% 0%
8.2Dart 16.3416.2527,156489  100% 1% 1% 0%
8.5Java  16.9316.8641,036514  1% 96% 4% 1%
9.3Erlang HiPE #2 71.1218.3928,684747  96% 97% 97% 97%
10Haskell GHC #2 44.1220.778,788403  36% 39% 39% 100%
11Lisp SBCL 20.9220.939,280625  1% 0% 100% 0%
11C# Mono 21.9221.9339,796459  100% 1% 1% 0%
18Erlang #2 144.2136.6022,676747  99% 98% 99% 98%
19Racket #2 37.9137.9136,656532  0% 1% 100% 1%
20Racket 39.8439.8423,520446  0% 0% 1% 100%
25Perl #4 190.7749.439,540551  96% 96% 99% 96%
26Hack #2 51.0751.08117,380398  1% 1% 0% 100%
51Ruby #3 6 min102.0140,236828  96% 97% 96% 96%
56Erlang HiPE 111.20111.2236,560507  0% 1% 99% 1%
64PHP #3 8 min126.5623,5161193  99% 99% 99% 99%
101Erlang 199.68199.7727,152507  29% 5% 25% 43%
107Python 3 #5 13 min211.8543,784437  99% 99% 99% 99%
107Perl 213.16213.225,536333  0% 1% 1% 100%
117Perl #5 232.00232.067,340340  1% 0% 0% 100%
123Ruby JRuby #4 250.63243.93673,640326  21% 24% 31% 28%
128Ruby JRuby #2 16 min253.95675,568776  98% 98% 98% 98%
129Perl #3 16 min255.1510,492846  100% 100% 100% 100%
133Ruby JRuby 270.52263.40673,976292  27% 27% 20% 31%
158Ruby #4 5 min5 min9,000326  0% 1% 100% 0%
193Ruby 6 min6 min7,676292  94% 0% 7% 1%
237PHP #2 7 min7 min7,252397  1% 0% 100% 1%
409Python 3 #6 13 min13 min6,480328  1% 100% 0% 0%
501Perl #2 16 min16 min4,096343  32% 37% 0% 32%
Rust Make Error898
Scala #4 Failed1006
Scala #3 Failed982
Scala #2 Failed720
"wrong" (different) algorithm / less comparable programs
1.0C++ g++ #2 7.921.991,7561330
1.0C++ g++ #7 7.921.993,7161283
1.2C gcc #2 2.322.32237,952669
3.8Python 3 #2 7.537.54489,356233
38Python 3 #3 75.1075.261,197,992379

 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