Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another small filled circe sub (not as fast as fcirc)
#47
Just a couple of things to point out, that I believe to be correct.

1) There should be no need to use INT() if we simply DIM x As Integer. Making the x variable an integer instead of a default single is faster. The system will convert the value automatically to an integer this way.

2) I assigned the variables to use in the SQR() calculation in the flat ellipse project asĀ  _Integer64. I discovered working with SQR() that this was required to avoid incorrect renderings with certain ellipse size numbers. 201 comes to mind.

3) Cobalt had mentioned that: " _SHL\_SHR are even faster if dealing with powers of 2." Well, I took a look at _SHL(y, 1) but unless I'm not familiar enough with bit flipping, this simply does not equal y ^2 or y * y. Also beyond 256 we have an issue, so I don't see making use of it. Am I wrong?

Also thanks to Steve for trying out what I previously referred to as using a hash table lookup method. I know array processing is a bit sluggish in QB64, for whatever reason, so it was interesting to see that precalculated input using arrays is about a push, perhaps a hair faster. Couple this with the baggage and it is just not practical unless you are interested in filling a billion circles and don't have a second to waste.

Pete
Shoot first and shoot people who ask questions, later.
Reply


Messages In This Thread
RE: Another small filled circe sub (not as fast as fcirc) - by Pete - 08-30-2024, 03:45 PM



Users browsing this thread: 20 Guest(s)