benchmarks/Ary.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 19 Jan 2013 23:19:12 +0000
branchrefactoring-vmdata
changeset 1985 7c5a14d663ba
parent 1818 2e5ed72e7dfd
child 2014 9fa66342102b
permissions -rw-r--r--
Temporary commit. JavaNativeMethod refactored to use new-style native methods. Java VM does not boot at this point.


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

JavaBenchmark subclass:#Ary
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Benchmarks-Java-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_SVN
    ^ '$Id::                                                                                                                        $'
! !