Iterating over a solid circle of pixels
The most important optimization is to save resources, not only avoid traversing the full square. For this reason the best option is to calculate the upper quarter of circle (hull) and then use scanlines - traverse row for fixed number of steps. Exploiting symmetry by calculating octant algorithm may not be the best option due to random access in the array and subtraction used (it should make no difference, but it happens). This is know as the midpoint circle algorithm.

Standard way is to calculate 1/8 of the circle, reflect it and use the hull, dividing circle into rows. The naive algorithm to calculate starting points uses round operation, which is time consuming (but still worth something due to actual avoiding square traversal). More optimized version is due to Bresenham circle which avoids rounding operation.