Skip to content

Conversation

@bp0002
Copy link

@bp0002 bp0002 commented Jun 12, 2025

Replace slower division and remainder with faster bit operations and addition

Copy link
Collaborator

@james7132 james7132 left a comment

Choose a reason for hiding this comment

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

Have you benchmarked this or looked at the generated assembly? At least on x86_64, the compiler already turns the division/remainder into bitshifts.

@bp0002
Copy link
Author

bp0002 commented Jun 30, 2025

Have you benchmarked this or looked at the generated assembly? At least on x86_64, the compiler already turns the division/remainder into bitshifts.

Thanks, I got it.

@bp0002 bp0002 closed this Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants