performance measurements

Each table row shows performance measurements for this JavaScript V8 program with a particular command-line input value N.

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
5000.150.15?373  0% 0% 0% 100%
3,0004.684.698,376373  1% 0% 0% 100%
5,50015.7015.7110,516373  1% 1% 0% 100%

Read the ↓ make, command line, and program output logs to see how this program was run.

Read spectral-norm benchmark to see what this program should do.

 notes

V8 version 3.27.16 [console: dumb]

 spectral-norm JavaScript V8 #3 program source code

// The Computer Language Benchmarks Game
// http://benchmarksgame.alioth.debian.org/
//
// contributed by Ian Osgood
// Optimized by Roy Williams

function A(i,j) {
  return 1/(((i+j)*(i+j+1)>>>1)+i+1);
}

function Au(u,v) {
    var n = u.length;
  for (var i=0; i<n; ++i) {
    var t = 0;
    for (var j=0; j<n; ++j)
      t += A(i,j) * u[j];
    v[i] = t;
  }
}

function Atu(u,v) {
  var n = u.length;
  for (var i=0; i<n; ++i) {
    var t = 0;
    for (var j=0; j<n; ++j)
      t += A(j,i) * u[j];
    v[i] = t;
  }
}

function AtAu(u,v,w) {
  Au(u,w);
  Atu(w,v);
}

function spectralnorm(n) {
  var storage_ = new ArrayBuffer(n * 24);
  var u = new Float64Array(storage_, 0, n),
      v = new Float64Array(storage_, 8*n, n),
      w = new Float64Array(storage_, 16*n, n);
  var i, vv=0, vBv=0;
  for (i=0; i<n; ++i) {
    u[i] = 1; v[i] = w[i] = 0; 
  }
  for (i=0; i<10; ++i) {
    AtAu(u,v,w);
    AtAu(v,u,w);
  }
  for (i=0; i<n; ++i) {
    vBv += u[i]*v[i];
    vv  += v[i]*v[i];
  }
  return Math.sqrt(vBv/vv);
}

print(spectralnorm(arguments[0]).toFixed(9));

 make, command-line, and program output logs

Sun, 01 Jun 2014 20:19:31 GMT

COMMAND LINE:
/usr/local/src/v8/out/native/d8 --nodebugger spectralnorm.v8-3.v8 -- 5500

PROGRAM OUTPUT:
1.274224153

Revised BSD license

  Home   Conclusions   License   Play