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

Optimisation: Remove final verify from branches (if they are the final statement of the function) #188

Open
rkalis opened this issue Apr 14, 2024 · 0 comments
Labels
cashc-compiler Relates to the cashc compiler enhancement New feature or request

Comments

@rkalis
Copy link
Member

rkalis commented Apr 14, 2024

Currently, if the final "require" statement in a function happens within a branch, we do not remove it, instead we leave it as OP_VERIFY OP_1 to ensure that the "implicit verify" at the end of the execution succeeds. It would save 2 bytes per case if we can remove that. We need to make sure to do it in a correct and safe way though, which can be hard considering edge cases.

If/when we implement this, we also need to make sure that this does not break the "require message" debug functionality, but this should be covered by current tests.

This is not a very high priority.

@rkalis rkalis added the enhancement New feature or request label Apr 14, 2024
@mr-zwets mr-zwets added the cashc-compiler Relates to the cashc compiler label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cashc-compiler Relates to the cashc compiler enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants