benchmarks/Ary.st
author Claus Gittinger <cg@exept.de>
Fri, 17 Aug 2018 18:45:10 +0200
branchcvs_MAIN
changeset 3795 b696900fb824
parent 3412 df11bb428463
child 3508 622620308fee
permissions -rw-r--r--
#BUGFIX by cg class: JavaVM class changed: #awtEventsForEvent:javaWindow:

"{ Package: 'stx:libjava/benchmarks' }"

JavaBenchmark subclass:#Ary
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Benchmarks-Java-Obsolete-Micro'
!


!Ary methodsFor:'running'!

runAryTest: x with: y with: n
	1 to: 1000 do: [:ignored|
			n to: 1 by: -1 do: [:i| y at: i put: (y at: i) + (x at: i)] ].
!

runBenchmarkS:n 
    | x  y |

    x := (1 to:n) asArray.
    y := Array new:n withAll:0.
    ^ Time 
        millisecondsToRun:[
            self 
                runAryTest:x
                with:y
                with:n
        ].
! !

!Ary class methodsFor:'documentation'!

version_CVS
    ^ '$Header: /cvs/stx/stx/libjava/benchmarks/Ary.st,v 1.5 2015-03-20 12:08:01 vrany Exp $'
!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_SVN
    ^ 'Id::                                                                                                                        '
! !