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

Use bit instead of power of two (2 ^ i) #900

Merged
merged 2 commits into from
Jan 13, 2023
Merged

Conversation

elopez
Copy link
Member

@elopez elopez commented Jan 10, 2023

We are computing powers of two, so using bit performs better.

We are computing powers of two, so using `bit` performs better.
@ggrieco-tob
Copy link
Member

This is great, but can you keep replacing the usage of 2 ^ i in the same file ? 🙂

2^256 is not representable in a Word256.
@elopez
Copy link
Member Author

elopez commented Jan 10, 2023

@ggrieco-tob I did a quick test with most of the 2 ^ x replaced but I did not notice any change in execution times. Also earlier when I profiled a run, I did not see them taking a significant chunk of time. I'm not sure if it is worth changing the other instances.

Maybe if we use fixed size types instead of Integer it would be faster? I'm just guessing at this point 🤔

@ggrieco-tob ggrieco-tob merged commit 428483c into master Jan 13, 2023
@ggrieco-tob ggrieco-tob deleted the dev-constants-opt branch January 13, 2023 10:58
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