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

more bitwise trickery #171

Merged
merged 1 commit into from Jan 9, 2020
Merged

more bitwise trickery #171

merged 1 commit into from Jan 9, 2020

Conversation

Rich-Harris
Copy link
Owner

Per this comment from @Th0rN13. According to my microbenchmarks, this is indeed a (probably very modest!) performance win

@kzc
Copy link
Contributor

kzc commented Jan 9, 2020

LGTM

I thought the V8 engine would make the same optimizations for powers of 2, but I see that this PR is around 0.3 seconds faster for 100MB of input on node 12, and around 0.75 seconds faster on older JS engines.

In the original bit set proposal I was trying to determine what the maximum number of bits that could be used in integer bit operations on JS engines. Since a JS double (IEEE 754) has a 53 bit significand I was hoping it would be higher than 32. Not the case.

@Rich-Harris Rich-Harris merged commit 4e1514f into master Jan 9, 2020
@Rich-Harris Rich-Harris deleted the bitwise-operators branch January 9, 2020 13:44
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

3 participants