Paladin of the Pegasos
Posts: 1278 from 2004/2/8
From: Poland
Quote:
jPV wrote:
Mini with 3.19: 13.56s
Mini with 3.20: 5.23s
PB with 3.19: 13.72s
PB with 3.20: 5.88s
Interesting. Some bugfix maybe?
Quote:
BTW. can you make the test without using any Rnd functions, using other kind of calculations? Or share the source code for experiments?
As a matter of fact I did try some other calculations (pure adding in one instance) and Mini still won with G5 (not by such margin as in our disputed case, but nevertheless).
I even wrote a simple program drawing 200000 red boxes all over the screen. Still the G4 won with G5 (11 seconds vs 13 seconds). The only upside was - the executable generated for Windows did much worse, scoring well over 1 minute on my machine.
As for the code - nothing to be proud of, really. Here you go:
counter = 0
max_counter = 1000000
inside = 0
StartTimer(1)
For counter = 0 To max_counter
x = RndF()
y = RndF()
If (x^2+y^2) < 1 Then inside = inside+1
Next
epi = 4 * inside / max_counter
countingTime = GetTimer(1)
countingTime = countingTime / 1000
Print("przyblizona wartosc Pi to " .. epi .. ", obliczenia zajely " .. countingTime .. " sekund.")
WaitLeftMouse
End