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

proposal for destructive comparison opcode #5

Open
zack-bitcoin opened this issue Jul 20, 2019 · 1 comment
Open

proposal for destructive comparison opcode #5

zack-bitcoin opened this issue Jul 20, 2019 · 1 comment

Comments

@zack-bitcoin
Copy link
Owner

we have an opcode to check if things are equal, and it leaves those things on the stack.
This is a good optimization for using ram while processing the smart contract, but it means we are using 4 opcodes every time we check equivalence, which is something we do in practically every function.

If we also had an equivalence operator that destroyed the things after comparing them, it would save 3 bytes per comparison in a program.

@zack-bitcoin
Copy link
Owner Author

this is now live in the experimental branch.

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

No branches or pull requests

1 participant