/mobile Handheld Friendly website

 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
1,0003.023.0621,952467  0% 1% 1% 99%
4,00047.1747.2021,948467  0% 0% 0% 100%
16,000758.88759.1922,216467  0% 0% 0% 100%

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

Read mandelbrot benchmark to see what this program should do.

 notes

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

 mandelbrot Smalltalk VisualWorks #2 program source code

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

!Tests class methodsFor: 'benchmarking'!
mandelbrot2: extent to: output
   | limit2 m bits zr zi cr ci i tr stepr stepi |
   limit2 := 4.0d0.
   m := 50.

   stepr := 2.0d0 / extent.
   stepi := 2.0d0 / extent.

   0 to: extent - 1 do: [ :y |
       bits := 0.
       ci := stepi * y asFloat - 1.0d0.
       0 to: extent - 1 do: [ :x |
           cr := stepr * x asFloat - 1.5d0.
           zr := cr. zi := ci.

           bits := bits bitShift: 1.
           i := 1.  
           [
               tr := (zr*zr) - (zi*zi) + cr.
               zi := 2.0d0 * zr * zi + ci.
               zr := tr.
               (zr*zr) + (zi*zi) < limit2 and: [ (i := i + 1) < m ]
           ] whileTrue.

           i = m ifTrue: [ bits := bits + 1 ].
           (x bitAnd: 7) == 7 ifTrue: [
               output nextPut: bits.
               bits := 0.
           ]
       ]. 
       (extent bitAnd: 7) == 0 ifFalse: [
           bits := bits bitShift: 8 - (extent bitAnd: 7).
           output nextPut: bits.
       ]
   ]! !


!Tests class methodsFor: 'benchmark scripts'!
mandelbrot2
   | n output |
   n := self arg.
   (output := self stdout)
      nextPutAll: 'P4'; nl; print: n; space; print: n; nl;
      binary.

   self mandelbrot2: n to: output.
   ^''! !

 make, command-line, and program output logs

Thu, 07 Feb 2013 00:11:58 GMT

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

(BINARY) PROGRAM OUTPUT NOT SHOWN

Revised BSD license

  Home   Conclusions   License   Play