1781
|
1 |
|
1761
|
2 |
"{ Package: 'stx:libjava/benchmarks' }"
|
|
3 |
|
|
4 |
JavaBenchmark subclass:#Ary
|
|
5 |
instanceVariableNames:''
|
|
6 |
classVariableNames:''
|
|
7 |
poolDictionaries:''
|
|
8 |
category:'Benchmarks-Java-Micro'
|
|
9 |
!
|
|
10 |
|
|
11 |
|
|
12 |
!Ary methodsFor:'running'!
|
|
13 |
|
|
14 |
runAryTest: x with: y with: n
|
1781
|
15 |
1 to: 1000 do: [:ignored|
|
1761
|
16 |
n to: 1 by: -1 do: [:i| y at: i put: (y at: i) + (x at: i)] ].
|
|
17 |
!
|
|
18 |
|
1762
|
19 |
runBenchmarkS:n
|
|
20 |
| x y |
|
|
21 |
|
|
22 |
x := (1 to:n) asArray.
|
|
23 |
y := Array new:n withAll:0.
|
|
24 |
^ Time
|
|
25 |
millisecondsToRun:[
|
|
26 |
self
|
|
27 |
runAryTest:x
|
|
28 |
with:y
|
|
29 |
with:n
|
|
30 |
].
|
1761
|
31 |
! !
|
|
32 |
|
|
33 |
!Ary class methodsFor:'documentation'!
|
|
34 |
|
|
35 |
version_SVN
|
|
36 |
^ '$Id:: $'
|
|
37 |
! !
|