Page 1 of 1

The curious case of the SuperBASIC speed difference.

Posted: Wed Jul 22, 2020 7:15 pm
by stephen_usher
I made a bit of a personal discovery last night whilst just writing a test program when mucking about with the B&W telly.

The same QL with a Trump Card is faster.

I wrote a little program:

Code: Select all

10 CLS
20 SDATE 2020,7,22,0,0,0
30 PRINT DATE$
40 FOR x=0 TO 10000
50 AT 1,0
60 PRINT x
70 NEXT x
80 PRINT DATE$
On the unexpanded QL (JS ROM) this takes either 3m 15s or 3m 17s (nothing in between and it seems random which one you get) but with the Trump Card installed it's 3m 2s or 3m 3s. That's quite a difference. Any idea why this may be the case? These are both with a clean power-up and the program typed in.

Re: The curious case of the SuperBASIC speed difference.

Posted: Wed Jul 22, 2020 7:49 pm
by tofro
stephen_usher wrote:I made a bit of a personal discovery last night whilst just writing a test program when mucking about with the B&W telly.

The same QL with a Trump Card is faster.

On the unexpanded QL (JS ROM) this takes either 3m 15s or 3m 17s (nothing in between and it seems random which one you get) but with the Trump Card installed it's 3m 2s or 3m 3s. That's quite a difference. Any idea why this may be the case? These are both with a clean power-up and the program typed in.
That is caused by the memory layout of the QL that shares screen memory and main memory. The lower 128k RAM are being accessed both by the CPU and the ULA, making memory accesses to that region effectively ~50% slower (because CPU and ULA have to wait for each other until an access to that memory is finished).

SuperBASIC programs mainly execute code from ROM (which is uncontended), so only data access to variables and the program code in lower memory is slowed down - The effect is even worse with machine code programs that mainly execute code from RAM. On a Trump card, preferred memory allocation is from top to bottom, so most data is located in non-contended memory.

Tobias

Re: The curious case of the SuperBASIC speed difference.

Posted: Wed Jul 22, 2020 8:08 pm
by stephen_usher
Ah, I didn't realise that above 128K it was uncontended, I thought that it was all compromised by video access.

Re: The curious case of the SuperBASIC speed difference.

Posted: Wed Jul 22, 2020 9:17 pm
by tofro
stephen_usher wrote:Ah, I didn't realise that above 128K it was uncontended, I thought that it was all compromised by video access.
Nope, and this is why really well-designed memory extensions can speed up a QL significantly.