Speed comparison
Posted: Fri Apr 25, 2014 7:50 pm
DrChip is a very active member of the forum on the other app: 'Basic!'
He has made a "Graphic bench mark test".
See http://appball.com/basic/viewtopic.php?f=7&t=4730
In order to compare the two 'basic' apps, I have adapted that program to run on Smart Basic.
Result:
IF test =1 (pixels) THEN Smart Basic is 12.7 times faster then Basic!
IF test=2 (circles) THEN Smart Basic is 5.6 times faster then Basic!
test=3 could not be compared because Smart Basic has no TRIANGLE function (made for '3D' drawing).
Part of the speed difference is explained by the fact that Basic! draws in anti-aliasing mode whereas Smart Basic draws at the coordinates unprocessed.
That can not explain the total difference. So champagne and flowers for Mr. K.
I have added the top left corner of the screenshots.
The names of the pictures explain the origin.
He has made a "Graphic bench mark test".
See http://appball.com/basic/viewtopic.php?f=7&t=4730
In order to compare the two 'basic' apps, I have adapted that program to run on Smart Basic.
Code: Select all
' Graphic bench mark test
' by DrChip » 01 Apr 2014, 17:30
' developed for the app 'Basic!'
' adapted for Smart Basic by Dutchman
' original 'Basic!' lines are commented out with '***
REM Benchmark - Dots per Second
REM iPhone 5s / 7.1 / 3.5.3
REM comment out the test your not using
REM is random not random still?
REM look at the triangles grouped
time=1000 '*** time = 1 'one second
test = 1 '1 point, 2 circle, 3 triangle
'*** prepare graphics for Smart Basic
GRAPHICS
GRAPHICS CLEAR 0,0,0
'*** end graphics initialisation for Smart Basic
loop:
DRAW COLOR RND(1),RND(1),RND(1) '*** COLOR RND*255,RND*255,RND*255
t=TIMER() '***t=TickCount
WHILE TIMER()-t<=time '*** WHILE TickCount-t<=time
x1=RND(1)*Screen_Width() '*** x1=RND*ScreenWidth
y1=RND(1)*Screen_Height() '*** y1=RND*ScreenHeight
IF test = 1 AND g=0 THEN
DRAW PIXEL x1,y1 '***POINT x1,y1,1
g=1
END IF
IF test = 2 AND g=0 THEN
DRAW CIRCLE x1,y1 SIZE 1 '*** CIRCLE x1,y1,1
g=1
END IF
/* Function TRIANGLE is not available in Smart Basic
IF test = 3 AND g=0 THEN
x2=RND*ScreenWidth
y2=RND*ScreenHeight
x3=RND*ScreenWidth
y3=RND*ScreenHeight
TRIANGLE x1,y1,x2,y2,x3,y3
g=1
END IF
*/
g= 0
d=d+1
END WHILE '*** WEND
GRAPHICS CLEAR 0,0,0'*** CLS
DRAW COLOR 1,1,1 '*** COLOR 1,1,1
DRAW TEXT "Current DPS: "&STR$(d,"#") AT 10,10 '*** DRAWTEXT "Current DPS: " + STR$(d), 0,0
d=0
GOTO loop
IF test =1 (pixels) THEN Smart Basic is 12.7 times faster then Basic!
IF test=2 (circles) THEN Smart Basic is 5.6 times faster then Basic!
test=3 could not be compared because Smart Basic has no TRIANGLE function (made for '3D' drawing).
Part of the speed difference is explained by the fact that Basic! draws in anti-aliasing mode whereas Smart Basic draws at the coordinates unprocessed.
That can not explain the total difference. So champagne and flowers for Mr. K.
I have added the top left corner of the screenshots.
The names of the pictures explain the origin.