Page 1 of 1

Some benchmarks

Posted: Sun Dec 01, 2013 11:13 am
by Henko
' i used the following benchmark program to check the calculation speed of Smart Basic on some hardware here, including
' the new iPhone 5S. The program inverts a 20x20 matrix with random elements.
'
' The results are:
' iPhone 3GS : 630 msec. (milliseconds)
' iPad 1 : 515 msec.
' iPad 3 : 235 msec.
' iPhone 5S. : 60 msec.
'
' using a pure graphics program (automaton) the 5S is also about 10 times faster than the 3GS.
'
option base 1 ! sz=20
dim ma(sz,sz),mi(sz,sz)
mat_rnd (sz,sz,ma,-10,10)
timer reset
mat_inv (sz,ma,mi)
print timer()
end

' produce a matrix with random elements between mini and maxi
'
def mat_rnd (n,m,mat(,),mini,maxi)
for i=1 to n
for j=1 to m ! mat(i,j)=mini+(maxi-mini)*rnd(1) ! next j
next i
end def

' produce the inverse of square matrix a() giving matrix ainv()
'
def mat_inv (nvar,a(,),ainv(,))
dim w(nvar,2*nvar)
for i=1 to nvar
for j=1 to nvar ! w(i,j)=a(i,j) ! w(i,j+nvar)=0 ! next j
w(i,i+nvar)=1
next i
for piv=1 to nvar
fac=w(piv,piv)
for j=piv to piv+nvar ! w(piv,j)=w(piv,j)/fac ! next j
for i=1 to nvar
if i<>piv then
fac=w(i,piv)
for j=piv to piv+nvar ! w(i,j)=w(i,j)-fac*w(piv,j) ! next j
endif
next i
next piv
for i=1 to nvar
for j=1 to nvar ! ainv(i,j)=w(i,j+nvar) ! next j
next i
end def

Re: Some benchmarks

Posted: Sun Dec 01, 2013 3:14 pm
by Mr. Kibernetik
So interesting!
iPhone 5S is so fast, incredible...

iOS 6 Simulator on my MacBook gives 74 ms.
iOS 7 Simulator gives 97 ms.

I have updated the test to perform multiple tests and returning average time.

Re: Some benchmarks

Posted: Thu May 05, 2016 7:04 pm
by rbytes
There are some gems to discover if you search back through previous pages of the Forum. This benchmark calculator, created by Henko and expanded by Mr. Kibernetik is just as useful today as when it was created over 2 years ago. At that time Henko posted these results:
' iPhone 3GS : 630 msec. (milliseconds)
' iPad 1 : 515 msec.
' iPad 3 : 235 msec.
' iPhone 5S. : 60 msec.
'
To those, I can now add:

iPad Air 1 : 28.8 msec.
iPhone 6 : 25.2 msec.

Re: Some benchmarks

Posted: Thu May 05, 2016 7:20 pm
by Mr. Kibernetik
iPad Air 2: 23.09 ms

Re: Some benchmarks

Posted: Thu May 05, 2016 9:10 pm
by rbytes
Nice!

Re: Some benchmarks

Posted: Fri May 06, 2016 2:11 am
by Dav
The lowest I get is 195 on iPad mini

- Dav

Re: Some benchmarks

Posted: Fri May 06, 2016 2:16 am
by rbytes
It might be a good idea to close all other apps before running this test.

Re: Some benchmarks

Posted: Fri May 06, 2016 2:19 am
by Dav
After closing apps I get

iPad mini : 191

iPod touch 5th gen: 243

- Dav

Re: Some benchmarks

Posted: Sat May 07, 2016 6:46 pm
by Operator
I get ~530ms on my iPhone 4 :shock:
Guess its time for a 5s... :)

But the "bottleneck" are the graphics...
So a combined bench-test would be better...