08-26-2022, 06:05 PM
(08-26-2022, 05:59 PM)bplus Wrote: Wow BF makes that much a difference? Seems like something is wrong about Line?
BF is highly optimized and is *much* faster than line, just as DO is faster than FOR...
A FOR loop has to track Start, Stop, Step, counting up or down... A DO loop is just DO.. LOOP and the user has to deal with the exit conditions. There's a lot less code to process for a DO-LOOP than there is a FOR-Next...
Same way with a line vs a line, BF. A line has slope. You calculate rise/run, do a loop, plot the necessary pixels, increment to the next pixel...
BF is just:
FOR y = start to stop
memfill x, x.start, s.stop, kolor
NEXT
Care to guess which is going to be faster, once you think about the basic premise behind them?
BF is always quite a bit faster than without it.