You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Problem
Forest.Read()
reads payloads from MTrie and makes a deep copy of both payload key and value.Forest.Read
is only called byLedger.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 toForest
in ledger package.The text was updated successfully, but these errors were encountered: