Skip to content
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

Prefer bitwise OR over addition for UTF-8 multi-byte encoding #1220

Open
wants to merge 1 commit into
base: 2.17
Choose a base branch
from

Conversation

cowtowncoder
Copy link
Member

(contributed by @xtonik)

@cowtowncoder
Copy link
Member Author

@xtonik Are bitwise logical operators faster than basic arithmetic (add, sub)? Back in the days costs were similar if not identical, but I haven't really been following on how CPU instruction costs fare these days.

So, basically, I assume this is expected to improve performance, but not sure how to verify: could build a micro-benchmark I guess but was guessing you have more information onthis.

@cowtowncoder cowtowncoder changed the title Prefer bitwise or over addition for UTF-8 multi-byte encoding Prefer bitwise OR over addition for UTF-8 multi-byte encoding Feb 15, 2024
@cowtowncoder
Copy link
Member Author

@xtonik Forgot to follow up on this -- do you have something (tests, articles) to support the idea that this helps speed up processing?

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.

None yet

2 participants