Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: old Basic benchmark

0 views
Skip to first unread message

rhnlogic

unread,
Dec 4, 2006, 7:19:10 PM12/4/06
to
The Byte Sieve benchmark (or a slight variation thereof) is used in
several of the big computer language shootouts, but versions of Basic
seems very under-represented in these comparisons.

Web sites for two big Computer Language Shootouts:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=nsieve&lang=all

http://dada.perl.it/shootout/sieve.html

ne...@rtrussell.co.uk wrote:
> rhnlogic wrote:
> > The following benchmark is a version of one from Byte Magazine
> > circa 1982 and 1983.
>
> As it stands it's not compatible with BASICs that execute FOR...NEXT
> loops at least once. In that case you need to add an extra IF clause:
>
> 240 if i+p > s then goto 280
>
> Here is BBC BASIC's profiler report; evidently accessing the array
> elements is the most timeconsuming operation (view with a monospaced
> font for best effect):
>
> 0: 100 REM Byte Sieve 1982,1983 benchmark
> 0: 110 s = 8192
> 0: 120 loops = 1000
> 1: 130 PRINT "start"
> 0: 140 t0 = TIME
> 0: 150 DIM f(s+3)
> 0: 160 c = 0
> 0: 170 FOR j = 1 TO loops
> 15: 180 FOR i = 0 TO s
> 3615: 190 f(i) = 1
> 1449: 200 NEXT i
> 8: 210 FOR i = 0 TO s
> 6938: 220 IF f(i) = 0 THEN GOTO 290
> 1265: 230 p = i+i+3
> 1571: 240 IF i+p > s THEN GOTO 280
> 687: 250 FOR k = i+p TO s STEP p
> 6757: 260 f(k) = 0
> 2560: 270 NEXT k
> 997: 280 c = c+1
> 1372: 290 NEXT i
> 0: 300 NEXT j
>
> Richard.
> http://www.rtrussell.co.uk/
> To reply by email change 'news' to my forename.


IMHO. YMMV.
--
rhn A.T nicholson d.0.t C-o-M

0 new messages