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

[Execution] Forest.Read() can use less memory #2475

Closed
fxamacker opened this issue May 24, 2022 · 1 comment
Closed

[Execution] Forest.Read() can use less memory #2475

fxamacker opened this issue May 24, 2022 · 1 comment
Assignees
Labels
Execution Cadence Execution Team Performance

Comments

@fxamacker
Copy link
Member

fxamacker commented May 24, 2022

Problem

Forest.Read() reads payloads from MTrie and makes a deep copy of both payload key and value. Forest.Read is only called by Ledger.Get . Ledger.Get creates a new slice of payload values and discards payload keys.

Deep copying payload key is unnecessary and it creates 4 heap allocations for each key.

Updates epic #1744

The Proposed Solution

Change Forest.Read to only deep copy and return payload values. This change is limited to Forest in ledger package.

@fxamacker
Copy link
Member Author

Closed by PR #2477. Not sure why it wasn't closed automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Execution Cadence Execution Team Performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants