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

runtime: don’t unnecessarily copy promise indices #8175

Merged
merged 4 commits into from
Dec 9, 2022

Conversation

mina86
Copy link
Contributor

@mina86 mina86 commented Dec 6, 2022

The promise_and method processes one promise index at a time. There’s
no benefit in having all them in memory. Rather than copying the
indices from Vec into a new Vec simply do the little endian
conversion while going through the former vector. This saves an
allocation.

The promise_and method processes one promise index at a time.  There’s
no benefit in having all them in memory.  Rather than copying the
indices from Vec<u8> into a new Vec<u64> simply do the little endian
conversion while going through the former vector.  This saves an
allocation.
@mina86 mina86 requested a review from a team as a code owner December 6, 2022 19:31
@mina86 mina86 requested a review from akhi3030 December 6, 2022 19:31
@akhi3030
Copy link
Collaborator

akhi3030 commented Dec 7, 2022

@Ekleog-NEAR : can you review this PR please?

@near-bulldozer near-bulldozer bot merged commit 0bff3cd into near:master Dec 9, 2022
@mina86 mina86 deleted the c branch December 9, 2022 02:54
nikurt pushed a commit to nikurt/nearcore that referenced this pull request Dec 14, 2022
The promise_and method processes one promise index at a time.  There’s
no benefit in having all them in memory.  Rather than copying the
indices from Vec<u8> into a new Vec<u64> simply do the little endian
conversion while going through the former vector.  This saves an
allocation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants