JamesD Posted July 7, 2019 Share Posted July 7, 2019 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. Quote Link to comment Share on other sites More sharing options...
JamesD Posted August 18, 2020 Share Posted August 18, 2020 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. Quote Link to comment Share on other sites More sharing options...
Maury Markowitz Posted December 8, 2020 Share Posted December 8, 2020 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? 2 Quote Link to comment Share on other sites More sharing options...
JamesD Posted November 5, 2022 Share Posted November 5, 2022 Tandy CoCo 3 emulated, my hardware multiply patch, and 6309 native mode. Just under 28.6 seconds including poking the patch & native mode control into RAM. Code is on the blog. https://jdiffendaffer.blogspot.com/2022/11/ahls-benchmark-revisited.html 1 Quote Link to comment Share on other sites More sharing options...
mr_gw454 Posted November 5, 2022 Share Posted November 5, 2022 11 hours ago, JamesD said: Tandy CoCo 3 emulated, my hardware multiply patch, and 6309 native mode. Just under 28.6 seconds including poking the patch & native mode control into RAM. Code is on the blog. https://jdiffendaffer.blogspot.com/2022/11/ahls-benchmark-revisited.html That's very impressive. Thanks for sharing the code! Quote Link to comment Share on other sites More sharing options...
Ricky Spanish Posted November 5, 2022 Share Posted November 5, 2022 (edited) Mine from original code: Also I need to take better photos 🙄 Edited November 5, 2022 by Ricky Spanish added info Quote Link to comment Share on other sites More sharing options...
+Larry Posted November 5, 2022 Author Share Posted November 5, 2022 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 Quote Link to comment Share on other sites More sharing options...
Ricky Spanish Posted November 5, 2022 Share Posted November 5, 2022 (edited) 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 November 5, 2022 by Ricky Spanish my grammar sucks. Quote Link to comment Share on other sites More sharing options...
JamesD Posted November 5, 2022 Share Posted November 5, 2022 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. Quote Link to comment Share on other sites More sharing options...
+Spaced Cowboy Posted November 6, 2022 Share Posted November 6, 2022 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 ... Quote Link to comment Share on other sites More sharing options...
JamesD Posted November 6, 2022 Share Posted November 6, 2022 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. Quote Link to comment Share on other sites More sharing options...
+Spaced Cowboy Posted November 6, 2022 Share Posted November 6, 2022 7 hours ago, JamesD said: Read Maury's post again. I think it was on a Mac. Ah, gotcha. I’d somehow read it as being processed on the Mac then run on an Atari. Quote Link to comment Share on other sites More sharing options...
JamesD Posted November 6, 2022 Share Posted November 6, 2022 22 hours ago, Ricky Spanish said: Sinclair ZX-81 13.5 503.54383 1.23 That looks a little low for the Sinclair Quote Link to comment Share on other sites More sharing options...
Ricky Spanish Posted November 6, 2022 Share Posted November 6, 2022 16 minutes ago, JamesD said: That looks a little low for the Sinclair I have no clue as I never owned one. Quote Link to comment Share on other sites More sharing options...
Ricky Spanish Posted April 30, 2023 Share Posted April 30, 2023 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 Quote Link to comment Share on other sites More sharing options...
Ricky Spanish Posted June 1, 2023 Share Posted June 1, 2023 (edited) 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 June 1, 2023 by Ricky Spanish clarity 1 Quote Link to comment Share on other sites More sharing options...
+DjayBee Posted June 1, 2023 Share Posted June 1, 2023 16 minutes ago, Ricky Spanish said: 1020 SC=SC/60:? SC;" SECONDS" Not everyone lives in the land of the weird-color-TVs. For PAL or SECAM this should be a division by 50. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.