Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use Box<[InstructionBox]> in Executable #5092

Closed
dima74 opened this issue Sep 20, 2024 · 0 comments · Fixed by #5096
Closed

Use Box<[InstructionBox]> in Executable #5092

dima74 opened this issue Sep 20, 2024 · 0 comments · Fixed by #5096
Assignees

Comments

@dima74
Copy link
Contributor

dima74 commented Sep 20, 2024

enum Executable {
    Instructions(Vec<InstructionBox>),
    Wasm(WasmSmartContract),
}

Vec<InstructionBox> in some cases allocates an initial buffer with size 4 (#5083 (comment)). InstructionBox is a large type (176 bytes), so it is worth replacing it with a read-only Box<[InstructionBox]> to be sure we don't waste memory on unused buffer capacity.

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

Successfully merging a pull request may close this issue.

1 participant