Was playing with some BASIC code. Screen 128/$80
Filling the screen with two nested FOR loops using PSET.
Switched PSET to FRAME with X1=X2 and Y1=Y2 which does
exactly the same thing as PSET.
The code with FRAME filled the screen marginally faster.
This means PSET could benefit from a little optimization.
I tried the same thing with RECT and it was a little slower than PSET
FRAME FASTER THAN PSET
Re: FRAME FASTER THAN PSET
Are you sure about this? My test shows RECT is a good 57% slower than PSET for setting single pixels.
here's my test code
here's my test code
100 SCREEN 128 110 T1=TI 120 FOR Y=0 TO 10 130 FOR X=0 TO 319 140 PSET X,Y,2 150 NEXT 160 NEXT 170 PRINTTI-T1 180 INPUT 210 T1=TI 220 FOR Y=11 TO 21 230 FOR X=0 TO 319 240 FRAME X,Y,X,Y,3 250 NEXT 260 NEXT 270 PRINTTI-T1
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: FRAME FASTER THAN PSET
RECT IS SLOWER.
FRAME IS MAYBE 1 TO 3% FASTER
FRAME IS MAYBE 1 TO 3% FASTER
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: FRAME FASTER THAN PSET
I'm timing the entire screen draw
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: FRAME FASTER THAN PSET
I'm running multiple instances of the emulator while I'm doing this so it's possible
I'm not getting the correct results. Could be OS timing.
I'm not getting the correct results. Could be OS timing.
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: FRAME FASTER THAN PSET
I had about 7 instances of the emulator running....
I'll hold off judgement until I run it on Hardware...... lol
It was a very minor difference.
I'll hold off judgement until I run it on Hardware...... lol
It was a very minor difference.
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: FRAME FASTER THAN PSET
I thought the result was strange myself... I killed all my instances of the emulator
and opened up just 1.......
I ran your code and I did indeed find that FRAME benchmarked slower
But on my system it was only about 30% slower not 57%....
I guess the system and OS make a difference too.
and opened up just 1.......
I ran your code and I did indeed find that FRAME benchmarked slower
But on my system it was only about 30% slower not 57%....
I guess the system and OS make a difference too.
Re: FRAME FASTER THAN PSET
What are the numbers you got?
I got 185 and 291.
291/185 is 1.57 and 185/291 is 0.63.
So depending on how you do the math, you can say that 291 is 57% slower, or that 185 is 0.63 times 291, making PSET 37% faster.
I guess it depends on your point of reference.
I got 185 and 291.
291/185 is 1.57 and 185/291 is 0.63.
So depending on how you do the math, you can say that 291 is 57% slower, or that 185 is 0.63 times 291, making PSET 37% faster.
I guess it depends on your point of reference.