Benchmarking

Let's talk about anything related to the 6502 microprocessor.
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Benchmarking

Post by drogon »

BillG wrote:
To be honest, I have not personally run your benchmark so have no experience with it.

I have little interest in benchmarking BASIC interpreters and probably will not until floating point is implemented in my compiler.
At which point the speed-ups are going to be marginal unless you can better the FP code used in BBC Basic 4. You'll save on things like loop variables which are also floating point if you can detect and reduce them to integer values and the usual other BASIC overheads like end of statement/line detection, next line, GOTOs and so on.

If I can be bothered I'll make a condensed BBC Basic version, however when I hand-translating this on a statement by statement basis into compiled BCPL on the same platform it did go significantly faster, however 4-byte floats vs. 5 bytes in BBC Basic, also I was using a floating point co-processor - which is still an 8-bit micro running at 16Mhz (same speed as my '816), however it has the advantage of a hardware 2-cycle 8x8 multiply.

The limit for this really is floating point performance.

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
BillG
Posts: 710
Joined: 12 Mar 2020
Location: North Tejas

Re: Benchmarking

Post by BillG »

So in your benchmark, all of that BASIC code is merely "glue" between a number of expensive floating point operations. Got it.

That reminds me of a post I have been meaning to make about compiled glue code between expensive operations...
fachat
Posts: 1124
Joined: 05 Jul 2005
Location: near Heidelberg, Germany
Contact:

Re: Benchmarking

Post by fachat »

Just started reading this thread so no idea if it has been mentioned before....https://extrapages.de/archives/20140804 ... hmark.html
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Benchmarking

Post by BigEd »

Nice read, thanks!
litwr
Posts: 188
Joined: 09 Jul 2016

Re: Benchmarking

Post by litwr »

Where was the fastest ROM Basic written? It seems that the fastest ROM Basic is not American, not British, not Russian, but Swedish.
Results of my experiments with the ABC 800 emulated on MAME/MESS show that the ABC 802 can build this fractal picture for about 93 seconds. It is faster than the BBC Master 128. The ABC 800 is a computer released in 1981. Its CPU is relatively slow, it is the Z80@3MHz. So its results are really great. However it uses single precision FP by default, 4 bytes for a number. BBC Basic uses 5 bytes. So if we normalize results giving 25% advance to the BBC Master we get that the BBC Master is slightly faster after all.
ABC Basic uses semi-compilation. It does error checking immediately, you don't need to start program to get a break on a error. Moreover it can handle long fp numbers with up to 125 digits! Such thing was possible only on mainframes in 1981!
Attachments
abc802-mandel.png
abc802-mandel.png (3.37 KiB) Viewed 2614 times
Last edited by litwr on Mon Sep 27, 2021 7:21 am, edited 1 time in total.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Benchmarking

Post by BigEd »

(do you have a reference for 125 digit calculation? I can't find it!)
litwr
Posts: 188
Joined: 09 Jul 2016

Re: Benchmarking

Post by litwr »

BigEd wrote:
(do you have a reference for 125 digit calculation? I can't find it!)
I have made a screenshot
abc802-longfp.png
abc802-longfp.png (3.82 KiB) Viewed 2617 times
These long fp operations are described in this Basic manual.

It is astonishing that even the ABC80 from 1978 had almost the same Basic features as the ABC800. Of course, ABC80 Basic is less developed and slower than ABC800 Basic.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Benchmarking

Post by BigEd »

Thanks -that's wonderful. So we have ADD$, MUL$, DIV$ which take two strings and optionally a precision. A very nice way to provide for conventional integer and floating point, as well as extended precision arithmetic.
litwr
Posts: 188
Joined: 09 Jul 2016

Re: Benchmarking

Post by litwr »

I have just run the benchmark on the emulated ABC802 using double precision FP. The result is 205s - it is approximately 120% slower than single precision FP result. So the dependency between the accuracy and timing is more than linear and this means that the BBC Master normalized Basic performance is even greater if we compare it with the ABC performance.
More results is here. It would be interesting to add a result from the Master Compact. Wiki claims that its Basic is about 30% faster than Basic of the BBC Master.
the ABC802 doupble precision fp
the ABC802 doupble precision fp
abc802-mandel-double.png (3.42 KiB) Viewed 2568 times
Post Reply