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

Add Avoiding Signed Integers in Calldata to gas optimization #771

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

jackleeio
Copy link
Contributor

Pre-flight checklist

Copy link

vercel bot commented Oct 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
conflux-documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 26, 2024 2:29pm

Copy link
Contributor

@intrepidcanadian intrepidcanadian left a comment

Choose a reason for hiding this comment

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

can you add in the gas comparison table the gas total?

for -1 it is 32 bytes of non-zero data costing 32 × 16 = 512 gas
for 1 it is 31 zero bytes of non-zero data and 1 byte of non-zero data costing 31×4 + 1×16 = 140 gas.

Thanks

@intrepidcanadian
Copy link
Contributor

Rather than titling it "Avoiding Signed Integers in Calldata" would it be more appropriate to "Reducing Gas Costs through Reduction of Non-Zero Bytes"

Thanks

@0xn1c0 0xn1c0 merged commit 530c1a1 into Conflux-Chain:main Nov 26, 2024
2 checks passed
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.

3 participants