performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
5000.830.8722,220438  0% 3% 1% 97%
3,00027.5527.5624,592438  0% 0% 0% 100%
5,50095.3495.4027,236438  0% 0% 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

VisualWorks® Personal Use Edition Release 7.9 of May 11, 2012

14289 samples, 39.1 average ms/sample, 319397 scavenges, 3 incGCs,
398.22s active, 159.61s other processes,
558.76s real time, 0.93s profiling overhead

** Tree **
100.0 BlockClosure [] in Shootout.Tests class>>unboundMethod
  100.0 Shootout.Tests class>>spectralnorm:
    100.0 Array>>multiplyAtAv
      50.1 Array>>multiplyAv
        46.4 primitives
        3.7 SmallInteger>>matrixA:
      49.9 Array>>multiplyAtv
        46.5 primitives
        3.4 SmallInteger>>matrixA:

** Totals **
46.5 Array>>multiplyAtv
46.4 Array>>multiplyAv
7.1 SmallInteger>>matrixA:

 spectral-norm Smalltalk VisualWorks #2 program source code

"* The Computer Language Benchmarks Game
    http://benchmarksgame.alioth.debian.org/
    contributed by Paolo Bonzini *"!

!Array methodsFor: 'benchmarking'!
multiplyAtAv
   ^(self multiplyAv) multiplyAtv! !

!Array methodsFor: 'benchmarking'!
multiplyAtv
   | n atv sum |
   n := self size.
   atv := Array new: n.
   1 to: n do: [:i|
      sum := 0.0d0.
      1 to: n do: [:j|
         sum := sum + ((j matrixA: i) * (self at: j)) ].
      atv at: i put: sum].
   ^atv! !

!Array methodsFor: 'benchmarking'!
multiplyAv
   | n av sum |
   n := self size.
   av := Array new: n.
   1 to: n do: [:i|
      sum := 0.0d0.
      1 to: n do: [:j|
         sum := sum + ((i matrixA: j) * (self at: j)) ].
      av at: i put: sum].
   ^av! !


!SmallInteger methodsFor: 'benchmarking'!
matrixA: anInteger
   ^1.0d0 / ((self + anInteger - 2) * (self + anInteger - 1) /2  + self)! !


!Tests class methodsFor: 'benchmarking'!
spectralnorm: n
   | u v vBv vv |
   u := Array new: n withAll: 1.0d0.
   10 timesRepeat:
      [v := u multiplyAtAv.
       u := v multiplyAtAv].
   vBv := 0.0d0.
   vv := 0.0d0.
   1 to: n do:
      [:i |
       vBv := vBv + ((u at: i) * (v at: i)).
       vv := vv + ((v at: i) * (v at: i))].
   ^(vBv / vv) sqrt! !


!Tests class methodsFor: 'benchmark scripts'!
spectralnorm2
   self stdout print: (self spectralnorm: self arg) digits: 9; nl.
   ^''! !

 make, command-line, and program output logs

Thu, 07 Feb 2013 00:41:57 GMT

COMMAND LINE:
/usr/local/src/vw7.9pul/bin/linux86/vwlinux86 /usr/local/src/vw7.9pul/image/benchmarks.im -nogui -evaluate "Tests spectralnorm2" -a 5500

PROGRAM OUTPUT:
1.274224153

Revised BSD license

  Home   Conclusions   License   Play