Re: Compiler Speed Trials
boriel wrote:
A Question: Are you using float or fixed? Or both?
BM7 is Integer only.
BM8 uses the sine and ln functions, so is Float.
fSin moves the sin function to Fixed. Still uses ln (float) though.
boriel wrote:
A Question: Are you using float or fixed? Or both?
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8 BMDRAW
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30 80.18
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.26-r1812 -O3 1.36 29.00 (24.22 with fSin) 38.02
ZX Basic 1.27- r2114 -O3 30.42
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
ZX Basic 1.2.8-s644 -O3 1.34 29.02 (24.22 with fSin) 30.42
britlion wrote:New benchmarks with 1.2.8.s644. 1.26-r1603 is still the speed king for ZX Basic. Hisoft fastest overall.
Just for curiosity, I downloaded the "legacy" version on the website. It's version r1812. This also shows the slowdown, if you are trying to track when this happened.
Boriel, do you still have the code available to wind it back to 1.26-r1603? We don't have all versions for download any more!
''' BM7 Benchmark by britlion.
''' Compiles on: ZX Basic, Hisoft, Sinclair BASIC
''' Expected running time: 2.1 segs (ZX BASIC)
7 REM :INT +a,k,v,i,m()
DIM a, k, v, i as UInteger
8 REM : OPEN#
9 CLS
10 POKE 23672,0: POKE 23673,0
90 POKE 23672,0
100 LET a=0: LET k=5: LET v=0
110 LET a=a+1
120 LET v=k/2*3+4-5
130 GO SUB 1000
140 DIM m(5) as UInteger
150 FOR i=1 TO 5
160 LET m(i)=a
170 NEXT i
200 IF a<1000 THEN GO TO 110: END IF
210 PRINT CAST(FIXED, PEEK(Uinteger, 23672))/50.0
999 STOP
1000 RETURN
1001 PRINT v, m(0)
#include "fSin.bas"
FUNCTION t() as uLong
asm
DI
LD DE,(23674)
LD D,0
LD HL,(23672)
EI
end asm
end function
cls
DIM i as uInteger
DIM k,var,j as uByte
DIM time,endtime as uLong
LET k=5
LET i=2
let time =t()
goto start
subroutine:
return
'start:
label:
LET i=i+1
LET var=k/2*3+4-5
gosub subroutine
DIM M(5) as uInteger
FOR j=0 to 4
LET M(j)=i
NEXT j
IF i<1000 then GOTO label: END IF
goto finish
REM BM8
'start:
FOR i=1 to 100
result=i^2
result=ln(i)
result=Sin(i)
next i
goto finish
REM BM DRAW
start:
for i=1 to 127
draw i,160
plot i,0
next i
OVER 1
for i=0 to 80
plot 0,i
draw 250,i
next i
OVER 2
for i = 1 to 80
circle 127,87,i
next i
OVER 3
for i = 10 to 18
plot 127,87
draw i,i,i
next i
finish:
endtime=t()
OVER 0
print "Start:";time;" End:";endtime
print (CAST (FLOAT,t())-time)/50; " Seconds"
print "Done!"
print at 23,0;M(1);k;i;var;result
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8 BMDRAW
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30 80.18
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.26-r1812 -O3 1.36 29.00 (24.22 with fSin) 38.02
ZX Basic 1.27- r2114 -O3 30.42
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
ZX Basic 1.2.8-s644 -O3 1.34 29.02 (24.22 with fSin) 30.42
ZX Basic 1.2.8-s682 -O3 0.88 20.56 (16.94 with fSin) 21.14
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8 BMDRAW
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30 80.18
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.26-r1812 -O3 1.36 29.00 (24.22 with fSin) 38.02
ZX Basic 1.27- r2114 -O3 30.42
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
ZX Basic 1.2.8-s644 -O3 1.34 29.02 (24.22 with fSin) 30.42
ZX Basic 1.2.8-s682 -O3 0.88 20.56 (16.94 with fSin) 21.14
ZX Basic 1.2.8-s696 -O3 0.90 20.60 (16.98 with fSin) 21.18
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8 BMDRAW
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30 80.18
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.26-r1812 -O3 1.36 29.00 (24.22 with fSin) 38.02
ZX Basic 1.27- r2114 -O3 30.42
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
ZX Basic 1.2.8-s644 -O3 1.34 29.02 (24.22 with fSin) 30.42
ZX Basic 1.2.8-s682 -O3 0.88 20.56 (16.94 with fSin) 21.14
ZX Basic 1.2.8-s696 -O3 0.90 20.60 (16.98 with fSin) 21.18
ZX Basic 1.2.8-s758 -O3 0.90 20.76 (17.10 with fSin) 21.32
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8 BMDRAW
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30 80.18
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.26-r1812 -O3 1.36 29.00 (24.22 with fSin) 38.02
ZX Basic 1.27- r2114 -O3 30.42
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
ZX Basic 1.2.8-s644 -O3 1.34 29.02 (24.22 with fSin) 30.42
ZX Basic 1.2.8-s682 -O3 0.88 20.56 (16.94 with fSin) 21.14
ZX Basic 1.2.8-s696 -O3 0.90 20.60 (16.98 with fSin) 21.18
ZX Basic 1.2.8-s758 -O3 0.90 20.76 (17.10 with fSin) 21.32
ZX Basic 1.2.9-s815 -O3 0.90 20.54 (16.92 with fSin) 21.08
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8 BMDRAW
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30 80.18
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
ZX Basic 1.2.8-s644 -O3 1.34 29.02 (24.22 with fSin) 30.42
ZX Basic 1.2.8-s682 -O3 0.88 20.56 (16.94 with fSin) 21.14
ZX Basic 1.2.8-s696 -O3 0.90 20.60 (16.98 with fSin) 21.18
ZX Basic 1.2.8-s758 -O3 0.90 20.76 (17.10 with fSin) 21.32
ZX Basic 1.2.9-s815 -O3 0.90 20.54 (16.92 with fSin) 21.08
ZX Basic 1.3.0-s971 -O3 0.90 20.80 (17.16 with fSin) 21.40
britlion wrote:Here's the latest with 1.3.0 s971:
...
We were chasing zip2's 0.46s target and hisoft basic's 0.5s target on BM7 - but we seem to have lost the speed gain from the last test.![]()
Technically the slowest iteration for a few cycles. Bugfixes are unfortunately making the code a little bit more convoluted, I think.
boriel wrote:Could be. I've changed the FP scheme to consume less (much less) memory, but it's slowest. SHL is also a few T-states slower (the bugfix you pointed). It's my bet that it's related to FP routines. Did you use Float or Fixed? I'm still working in alternative Fast Floating Point (yes, based on your ideas, and a FP routine I'm programming).
Users browsing this forum: No registered users and 1 guest