Jump to content
IGNORED

Ahl's Benchmark?


Larry

Recommended Posts

As of the latest changes to the MC-10's BASIC, Ahl's Benchmark seems to run in 1:06.  Down another second... ish... I'm hand timing here.
Almost every other program has shown much more improvement with each revision, which indicates the bottleneck is SQR and ^.
And I've only exceeded the 8K ROM size by 191 bytes, most of which is a larger token jump table.
 

Link to comment
Share on other sites

  • 1 year later...

Resurrecting this old thread for a small update. 
My BASIC for the MC-10 completes the A=A*A version in 41 seconds now. 
I have to fix a bug before I can test the original A=A^2 version. 
Not sure if that will be much faster than the last number, but I do have an optimization I want to try that should speed that up if I get around to it.
Part of the speedup involved removing the ELSE statement I added. 
Makes a big difference on IF statements where the rest of the line is skipped.
 

Link to comment
Share on other sites

  • 3 months later...

I finally got my BASIC running. It's running in lex/yacc/c, and runs the native system, in my case, macOS. It is an interpreter, it reads the source and makes a structure that it then runs in a fashion similar to Atari BASIC - that is, it's fully tokenized before it runs, unlike MS. Here's Ahl's test:

 

run time 0.003066

Accuracy  6.82121E-13

Random  7.7737

 

Lolz?

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

Back on page 4 of this thread, there is an image of a whole page of benchmark results (submitted by readers).  Unfortunately, it is difficult to read the data.  I downloaded a PDF of the March 1984 issue of Creative Computing from archive.org and extracted that page.  It still has some issues, but it is much more legible.  The page is skewed left, and with my current software, I can't straighten it.  Perhaps someone else can?

Anyway, here is the followup data.

Ahl's Benchmark Followup Creative Computing March 1984.pdf

Link to comment
Share on other sites

another one :

 

50 S =0
100 X=0
200 FOR N = 1 TO 1000
300 S=S+X*X
400 X = X + 0.00123
500 NEXT N
600 PRINT S,X

Because of the repeated additions of floating point numbers of the same sign, this program does a good job of testing error propagation. The correct answers are:

S = 503.543802149
X = 1.23

Broucke states that those computers, such as the ATARI, that use a four byte mantissa for representing floating point numbers, can be expected to run about 25% slower than those that use a three byte mantissa, such as the IBM personal computer. The following abridged table lists some of the more popular computers along with times and answers:

         
 COMPUTER                                TIME     S             X        
 TRS color Computer                       37      503.543832	1.2300004
 Commodore Pet                            30      503.543832	1.23000004
 Commodore Vic-20                         27      503.543832	1.23000004	
 Apple 11                                 26      503.543832	1.23000004
 TRS-80 model II                          23      503.545       1.23
 Apple III                                20      503.545       1.23	
 Sinclair ZX-81                           13.5    503.54383     1.23
 Osborne I (MBASIC)                        8      503.545       1.23
 IBM Personal Computer                     7.5    503.545       1.230001
___________________________________________________________________________
 Atari 400/800 (ANTIC ON)                 15.5    503.543594    1.23
 Atari 400/800 (ANTIC OFF)                10.5    503.543594	1.23
 Atari 400/800 (ANTIC ON, with FASTCHIP)  11.5    503.543594	1.23
 Atari 400/800 (ANTIC OFF, with FASTCHIP)  8      503.543595	1.23

 

Mine:

1200XL (ANTIC ON, BASIC XE)                     5.86s    503.543803     1.23

Edited by Ricky Spanish
my grammar sucks.
Link to comment
Share on other sites

5 minutes ago, Ricky Spanish said:

another one :

 

50 S =0
100 X=0
200 FOR N = 1 TO 1000
300 S=S+X*X
400 X = X + 0.00123
500 NEXT N
600 PRINT S,X

Because of the repeated additions of floating point numbers of the same sign, this program does a good job of testing error propagation. The correct answers are:

S = 503.543802149
X = 1.23

Broucke states that those computers, such as the ATARI, that use a four byte mantissa for representing floating point numbers, can be expected to run about 25% slower than those that use a three byte mantissa, such as the IBM personal computer. The following abridged table lists some of the more popular computers along with times and answers:

         
 COMPUTER                                TIME     S             X        
 TRS color Computer                       37      503.543832	1.2300004
 Commodore Pet                            30      503.543832	1.23000004
 Commodore Vic-20                         27      503.543832	1.23000004	
 Apple 11                                 26      503.543832	1.23000004
 TRS-80 model II                          23      503.545       1.23
 Apple III                                20      503.545       1.23	
 Sinclair ZX-81                           13.5    503.54383     1.23
 Osborne I (MBASIC)                        8      503.545       1.23
 IBM Personal Computer                     7.5    503.545       1.230001
___________________________________________________________________________
 Atari 400/800 (ANTIC ON)                 15.5    503.543594    1.23
 Atari 400/800 (ANTIC OFF)                10.5    503.543594	1.23
 Atari 400/800 (ANTIC ON, with FASTCHIP)  11.5    503.543594	1.23
 Atari 400/800 (ANTIC OFF, with FASTCHIP)  8      503.543595	1.23

 

Mine:

1200XL (ANTIC ON, BASIC XE)                     5.86s    503.543803     1.23

CoCo wasn't in high speed mode from the looks of that.
Add this for a CoCo 1 & 2
POKE 65495,0
or this for a CoCo 3
POKE 65497,0

CoCo 3 in high speed mode, with the math patch, and 6309 does it in about 15.1 seconds.
 

Link to comment
Share on other sites

So, just for giggles, using the original BASIC code and converting it to C on my M1 Ultra, I get:

 

int main(int argc, const char * argv[])
	{
	printf("Accuracy          Random\n");
	double sum = 0;
	double r = 0.0;
	
	struct timeval stt, end, dt;
	gettimeofday(&stt, NULL);

	for (int n=1; n<=100; n++)
		{
		double a = n;
		
		for (int i=1; i<=10; i++)
			{
			a = sqrt(a);
			r = r + drand48();
			}
		
		for (int i=1; i<=10; i++)
			{
			a = pow(a, 2);
			r = r + drand48();
			}
		sum += a;
		}
	gettimeofday(&end, NULL);
	timersub(&end, &stt, &dt);
	
	printf("%.15f %f in %ld.%06d secs\n",
		abs(1010-sum/5), 1000 - r,
		dt.tv_sec, dt.tv_usec);
	
	return 0;
	}

 

which gives me:

Accuracy          Random
0.000000000000682 7.767806 in 0.000006 secs

 

That makes Maury's result above look spectacular. He's getting a run-time of 0.003066 secs in BASIC on a 1.7MHz 8-bit computer  - that's approx 1/5100 times the speed of compiled code running on fastest 64-bit Mac that Apple make ...

 

Link to comment
Share on other sites

6 hours ago, Spaced Cowboy said:

So, just for giggles, using the original BASIC code and converting it to C on my M1 Ultra, I get:

 

which gives me:

Accuracy          Random
0.000000000000682 7.767806 in 0.000006 secs

 

That makes Maury's result above look spectacular. He's getting a run-time of 0.003066 secs in BASIC on a 1.7MHz 8-bit computer  - that's approx 1/5100 times the speed of compiled code running on fastest 64-bit Mac that Apple make ...

 

Read Maury's post again.  I think it was on a Mac.
 

Link to comment
Share on other sites

  • 5 months later...
On 11/5/2022 at 4:16 PM, Ricky Spanish said:

1200XL (ANTIC ON, BASIC XE)                     5.86s    503.543803     1.23

1200XL (ANTIC ON, Turbo Basic XL)               6.31s    503.543594    1.23

 

Interesting in this case TBXL is slower than BASIC XE, but not in AHL benchmark. 

 

AHL BENCHMARK

Turbo: accuracy 0.013649

           random  5.592675

           seconds  41.55

 

BASIC XE: accuracy 0.014614

               random   32.978846

               seconds  50.566666

 

Link to comment
Share on other sites

  • 1 month later...

If you want to add a timer (in seconds) to AHL BENCHMARK add these lines:

 

0 POKE 18,0:POKE 19,0:POKE 20,0

1000 A=PEEK(18):B=PEEK(19):C=PEEK(20)

1010 SC=C+256*B+65536*A

1020 SC=SC/60:? SC;" SECONDS"

 

It doesn't affect the program at all as it sits outside the loops. 

 

EDIT: 1020 SC=SC/50:? SC;" SECONDS" 

for PAL tv's and there inferior slow-mo.

Edited by Ricky Spanish
clarity
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...