Skip to content

Optimize router opcode initialization for fallback and text receivers #3330

Description

@Gusarich

Currently, the router function separately initializes the op variable and then conditionally loads its value based on the incoming message length whenever fallback or text receivers are present, introducing unnecessary overhead.

Optimization task:
Replace this pattern (used for fallback and text receivers):

int op = 0;
int in_msg_length = slice_bits(in_msg);
if (in_msg_length >= 32) {
    op = in_msg~load_uint(32);
}

With the following optimized conditional assignment:

int in_msg_length = slice_bits(in_msg);
int op = (in_msg_length >= 32) ? in_msg~load_uint(32) : 0;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

scope: codegenCode generation, a.k.a. compiler backend (src/generator)

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions