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 Tact's runtime stdlib functions #1212

Open
anton-trunov opened this issue Dec 18, 2024 · 1 comment
Open

Optimize Tact's runtime stdlib functions #1212

anton-trunov opened this issue Dec 18, 2024 · 1 comment
Assignees
Labels
gas Gas consumption and fee-related things optimizations scope: codegen Code generation, a.k.a. compiler backend
Milestone

Comments

@anton-trunov
Copy link
Member

anton-trunov commented Dec 18, 2024

For instance, __tact_create_address in src/generator/writers/writeStdlib.ts contains the following:

var b = begin_cell();
b = b.store_uint(2, 2);
b = b.store_uint(0, 1);
...

It may be more gas efficient to combine the two stores of constants into one:

var b = begin_cell();
b = b.store_uint(4, 3);
...
@anton-trunov anton-trunov added gas Gas consumption and fee-related things scope: codegen Code generation, a.k.a. compiler backend labels Dec 18, 2024
@anton-trunov anton-trunov added this to the v1.6.0 milestone Dec 18, 2024
@anton-trunov
Copy link
Member Author

@jeshecdom you might want to look into this at some point, the example I provided is sort of an instance of things constant propagation analysis might resolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gas Gas consumption and fee-related things optimizations scope: codegen Code generation, a.k.a. compiler backend
Projects
None yet
Development

No branches or pull requests

2 participants