CIRCLE looked like the most innocent command in the manual. Until I wrapped a TIMER around it in my MMBasic vector game and saw what it cost per frame. It turned out to be one of the heaviest items in the renderer, and one I could drop without losing much.
Where I was using CIRCLE
Two places in the game called CIRCLE every frame.
First, every polygon corner on my asteroids got a tiny filled dot of radius 1 as a vertex marker, in the classic vector look. Ten corners per asteroid, forty asteroids on screen, that’s four hundred CIRCLE calls per frame.
Second, shots were drawn as little filled circles of radius 1, one per active bullet.
' old: a marker on every asteroid corner
FOR i = 0 TO num_verts - 1
CIRCLE temp_x(i), temp_y(i), 1, , , COL_WHITE, COL_WHITE
NEXT i
What profiling showed
I wrapped the frame phases with TIMER and dumped the ms values once a second. The drawing block was the heaviest, and inside it the CIRCLE calls dominated. My guess is CIRCLE does some antialiasing or at least multiple pixel operations per call, so the per-call overhead plus the actual drawing work makes it noticeably more expensive than PIXEL.
What I changed
The vertex markers were purely cosmetic. The polygons are already drawn as closed line strips with POLYGON, the dot on the corner didn’t add anything that wasn’t already there. Result: cut, no replacement.
' new: just POLYGON, done
POLYGON num_verts, tmp_x(), tmp_y(), COL_WHITE
For shots that genuinely needed to be a single pixel, I swapped CIRCLE for PIXEL:
' old
CIRCLE shot_x(i), shot_y(i), 1, , , COL_WHITE, COL_WHITE
' new
PIXEL shot_x(i), shot_y(i), COL_WHITE
PIXEL writes one pixel and that’s it, which makes it dramatically cheaper.
This was one of the biggest single wins in my renderer, the FPS climbed noticeably after both changes. As a side observation, a filled CIRCLE of radius 1 isn’t the same as a PIXEL — it covers several pixels and ends up looking chunky in a vector-style game. Even with performance off the table, PIXEL would have been the right call aesthetically. Since then I question every graphics call sitting in the hot path: PIXEL for points, LINE for strokes, POLYGON for closed shapes, CIRCLE only when I really mean a circle.