Skip to content

Optimize draw.aacircle and fix typo #3012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

mzivic7
Copy link
Contributor

@mzivic7 mzivic7 commented Jul 21, 2024

In draw_circle_xiaolinwu_thin, pow(radius, 2) was inside loop, but radius isn't changing.
So, radius is now moved outside of the loop.
Same thing happened in draw_circle_xiaolinwu.
Performance gain: 5% faster execution with r=100, and 6% with r=1000, for 1px wide line.
Also fixed typo: Xaolin -> Xiaolin

Moved pow(radius, 2) outside of loop
@mzivic7 mzivic7 requested a review from a team as a code owner July 21, 2024 23:53
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! 🥳

Copy link
Member

@damusss damusss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice :3

@damusss damusss added this to the 2.5.1 milestone Jul 22, 2024
@damusss damusss merged commit ba6d659 into pygame-community:main Jul 22, 2024
39 checks passed
@Starbuck5 Starbuck5 added Performance Related to the speed or resource usage of the project draw pygame.draw labels Jul 22, 2024
@mzivic7 mzivic7 deleted the aacircle_optimize branch July 22, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draw pygame.draw Performance Related to the speed or resource usage of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants