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

World's smallest micro-optimization #2318

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

kyri-petrou
Copy link
Collaborator

Full disclosure. This will probably have 0 meaningful impact to anyone's application, but I saw it the other day and couldn't help myself 🥲 I wouldn't be doing this is the previous code was intuitive or more readable, but I think they're both equally bad when it comes to readability.

Anyways, in APQs, instead of converting each byte into a string and extracting its 4-bit representation (hex), we just do the comparison on the fly avoiding materialising anything in memory.

@kyri-petrou kyri-petrou requested a review from paulpdaniels June 28, 2024 12:18
@ghostdogpr
Copy link
Owner

Hum... 🙄
I think the old one is definitely more readable 😅

@ghostdogpr ghostdogpr merged commit 3ab9d6a into series/2.x Jul 18, 2024
10 checks passed
@ghostdogpr ghostdogpr deleted the worlds-smallest-microoptimization branch July 18, 2024 06:34
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