/mobile Handheld Friendly website
x64 Ubuntu : Intel® Q6600® quad-core |
Each table row shows performance measurements for this Ruby JRuby program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 500 | 8.23 | 5.36 | 599,112 | 292 | 4% 26% 93% 32% |
| 3,000 | 93.13 | 90.02 | 613,116 | 292 | 0% 2% 49% 53% |
| 5,500 | 315.39 | 311.63 | 625,052 | 292 | 1% 1% 29% 71% |
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.
jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_11-b21 [linux-amd64]
# The Computer Language Benchmarks Game # http://benchmarksgame.alioth.debian.org/ # Contributed by Sokolov Yura def eval_A(i,j) return 1.0/((i+j)*(i+j+1)/2+i+1) end def eval_A_times_u(u) v, i = nil, nil (0..u.length-1).collect { |i| v = 0 for j in 0..u.length-1 v += eval_A(i,j)*u[j] end v } end def eval_At_times_u(u) v, i = nil, nil (0..u.length-1).collect{|i| v = 0 for j in 0..u.length-1 v += eval_A(j,i)*u[j] end v } end def eval_AtA_times_u(u) return eval_At_times_u(eval_A_times_u(u)) end n = ARGV[0].to_i u=[1]*n for i in 1..10 v=eval_AtA_times_u(u) u=eval_AtA_times_u(v) end vBv=0 vv=0 for i in 0..n-1 vBv += u[i]*v[i] vv += v[i]*v[i] end print "%0.9f" % (Math.sqrt(vBv/vv)), "\n"
Sat, 20 Apr 2013 00:35:45 GMT MAKE: mv spectralnorm.jruby spectralnorm.rb 0.02s to complete and log all make actions COMMAND LINE: /usr/local/src/jruby-1.7.3/bin/jruby -Xcompile.invokedynamic=true -J-server -J-Xmn512m -J-Xms2048m -J-Xmx2048m spectralnorm.rb 5500 PROGRAM OUTPUT: 1.274224153