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

General gas tweaks #63

Merged
merged 8 commits into from
Jun 3, 2024
Merged

General gas tweaks #63

merged 8 commits into from
Jun 3, 2024

Conversation

ChefMist
Copy link
Collaborator

@ChefMist ChefMist commented Jun 1, 2024

Part 2 of #57

General minor gas tweaks to reduce gas

@@ -69,7 +102,7 @@ library TickBitmap {
: (compressed - int24(uint24(bitPos))) * tickSpacing;
} else {
// start from the word of the next tick, since the current tick state doesn't matter
(int16 wordPos, uint8 bitPos) = position(compressed + 1);
(int16 wordPos, uint8 bitPos) = position(++compressed);
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this also help on gas ?? 😂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it removes the compressed + 1 below (removing 1 additional operation) -- thus saving gas

Copy link
Collaborator

@chefburger chefburger left a comment

Choose a reason for hiding this comment

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

The end of optimization is basically rewriting everything in assembly 😂

@ChefMist ChefMist merged commit 03ebac9 into main Jun 3, 2024
2 checks passed
@ChefMist ChefMist deleted the feat/gas-optimization-again branch June 3, 2024 02:47
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