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

Accounts incur a copy when passed to invoke that may not be neccissary #14696

Closed
jackcmay opened this issue Jan 20, 2021 · 1 comment
Closed

Comments

@jackcmay
Copy link
Contributor

Problem

When passing accounts to invoke the runtime copies the data out of the program space, calls the inner instruction processor, and then copies the data back. Now that programs exit on any error these copy operations are probably not necessary:

Specifically:

data: data.to_vec(),

for (i, (account, account_ref)) in accounts.iter().zip(account_refs).enumerate() {

Context: #14523

Proposed Solution

Remove this copy and just use the buffer directly.

Doing so s complicated by the fact that the buffer might be realloc via SystemProgram::CreateAccount or more generally later and there could be a conflict between the runtime and in-program allocator.

@jackcmay
Copy link
Contributor Author

Account copies reduced via:

#15813
#15799

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant