J
jvbeaupre
I'm a dedicated Mac and Excel and VBA user.
Right now my current Mac (1-GHz PowerPC) is about 10x slower than the
comparable windows machine for executing VBA macros in Excel.
My question is: Do the new Intel-chip Macs do VBA any faster than the
PowerPCs? (Scaled by processor speed, of course)
Anyone interested in helping me do the comparison by doing the
benchmark below on an Intel-chip Mac?
Here's the results (printed in the immediate window) for a 1-GHz
PowerPC G4 executioning the VBA code at the bottom:
1D: n= 100 Time= 7 -sec
1D: n= 200 Time= 24 -sec
1D: n= 400 Time= 97 -sec
Hoping to hear from some of you,
Jim
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub TEST_NN1DBF()
Dim d(), id()
ntrial = 100
n0 = 50
For m = 1 To 3
n = n0 * 2 ^ m
ReDim d(n), id(n)
t1 = Timer
For ii = 1 To ntrial
GoSub Get_Data_1
GoSub Eval_1
Next ii
Debug.Print "1D: n="; n, "Time="; Timer - t1
Next m
Exit Sub
Get_Data_1:
For i = 1 To n
d(i) = (1000 * Rnd())
Next i
Return
Eval_1: 'Brute force Nearest Neighbor ~ n^2 in execution time
For i = 1 To n
umin = 1e+37
x1 = d(i)
For j = 1 To n
If j <> i Then
If Abs(x1 - d(j)) < umin Then
umin = Abs(x1 - d(j))
id(i) = j
End If
End If
Next j
Next i
Return
End Sub
Right now my current Mac (1-GHz PowerPC) is about 10x slower than the
comparable windows machine for executing VBA macros in Excel.
My question is: Do the new Intel-chip Macs do VBA any faster than the
PowerPCs? (Scaled by processor speed, of course)
Anyone interested in helping me do the comparison by doing the
benchmark below on an Intel-chip Mac?
Here's the results (printed in the immediate window) for a 1-GHz
PowerPC G4 executioning the VBA code at the bottom:
1D: n= 100 Time= 7 -sec
1D: n= 200 Time= 24 -sec
1D: n= 400 Time= 97 -sec
Hoping to hear from some of you,
Jim
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub TEST_NN1DBF()
Dim d(), id()
ntrial = 100
n0 = 50
For m = 1 To 3
n = n0 * 2 ^ m
ReDim d(n), id(n)
t1 = Timer
For ii = 1 To ntrial
GoSub Get_Data_1
GoSub Eval_1
Next ii
Debug.Print "1D: n="; n, "Time="; Timer - t1
Next m
Exit Sub
Get_Data_1:
For i = 1 To n
d(i) = (1000 * Rnd())
Next i
Return
Eval_1: 'Brute force Nearest Neighbor ~ n^2 in execution time
For i = 1 To n
umin = 1e+37
x1 = d(i)
For j = 1 To n
If j <> i Then
If Abs(x1 - d(j)) < umin Then
umin = Abs(x1 - d(j))
id(i) = j
End If
End If
Next j
Next i
Return
End Sub