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

Optimize constants #56

Closed
jasonpaulos opened this issue Apr 15, 2021 · 0 comments · Fixed by #57
Closed

Optimize constants #56

jasonpaulos opened this issue Apr 15, 2021 · 0 comments · Fixed by #57
Assignees
Labels

Comments

@jasonpaulos
Copy link
Contributor

Summary

PyTeal currently outputs code using the pseudo-ops int, byte, and addr. It's up to the assembler to transform these pseudo-ops into int and byte constant blocks. This process can be optimized to reduce program size if the constant blocks are sorted by decreasing frequency of use, and if the new pushint and pushbytes ops are used for single-use constants.

Scope

  • Modify the prototype implementation of this from Add optimization to detect duplicates #41 into a general feature.
  • Add an option to compileTeal to enable this feature. By default it should not be enabled to maintain compatibility, at least for now.

Urgency

This has the potential to significantly reduce cost program size for large programs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant