News for hackers. Stuff that matters.
Re:I translated a simple C program to x86_64 and it was slower by kens on Saturday April 25, 2020 @03:27PM (#22980656)
I implemented the circle/ellipse drawing code in Microsoft Windows way back. Bresenham's algorithm is the way to go. The line drawing algorithm is better-known, but it can be extended to a circle. The idea is you calculate the coordinates incrementally, keeping track of the pixel error for each line. You scale the error so everything is simple integer arithmetic, no floating point or square roots needed.
Re:I translated a simple C program to x86_64 and it was slower by Porygon on Sunday April 26, 2020 @03:49AM (#22985379)
Wikipedia article for the curious:

https://en.wikipedia.org/wiki/Midpoint_circle_algorithm

The non-english articles have code.