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

[memory] Make tstate.Insert more efficient and use a sync.Pool in tokenvm.storage #127

Open
Tracked by #126
patrick-ogrady opened this issue Apr 3, 2023 · 2 comments · Fixed by #126
Open
Tracked by #126

Comments

@patrick-ogrady
Copy link
Contributor

Allocated memory:

Showing nodes accounting for 19.24GB, 48.93% of 39.32GB total
Dropped 435 nodes (cum <= 0.20GB)
Showing top 10 nodes out of 188
      flat  flat%   sum%        cum   cum%
    2.88GB  7.33%  7.33%     2.88GB  7.33%  github.com/ava-labs/hypersdk/tstate.(*TState).Insert
    2.64GB  6.71% 14.04%     2.64GB  6.71%  github.com/ava-labs/hypersdk/examples/tokenvm/storage.PrefixBalanceKey (inline)
    2.52GB  6.40% 20.44%     2.52GB  6.40%  github.com/ava-labs/avalanchego/utils/wrappers.(*Packer).expand
    2.47GB  6.28% 26.72%     2.47GB  6.28%  github.com/ava-labs/avalanchego/x/merkledb.(*trieView).invalidateChildrenExcept
       2GB  5.09% 31.81%        2GB  5.09%  golang.org/x/exp/maps.Clone[...] (inline)
    1.42GB  3.60% 35.41%     1.42GB  3.60%  github.com/ava-labs/avalanchego/x/merkledb.newPath (inline)
    1.41GB  3.58% 39.00%     3.41GB  8.67%  github.com/ava-labs/avalanchego/x/merkledb.(*node).clone
    1.33GB  3.39% 42.39%     3.51GB  8.93%  github.com/ava-labs/avalanchego/x/merkledb.(*trieView).calculateNodeIDsHelper
    1.29GB  3.28% 45.67%     1.29GB  3.28%  google.golang.org/grpc.(*parser).recvMsg
    1.28GB  3.27% 48.93%     3.07GB  7.82%  github.com/ava-labs/hypersdk/chain.(*Processor).Prefetch.func1
@patrick-ogrady patrick-ogrady changed the title [memory] Re-use tstate and processor.Prefetch keys [memory] Re-use tstate and tx.StateKeys keys Apr 3, 2023
@patrick-ogrady
Copy link
Contributor Author

@patrick-ogrady patrick-ogrady changed the title [memory] Re-use tstate and tx.StateKeys keys [memory] Make tstate.Insert more efficient and use a sync.Pool in tokenvm.storage Apr 3, 2023
@patrick-ogrady patrick-ogrady mentioned this issue Apr 3, 2023
6 tasks
@patrick-ogrady patrick-ogrady linked a pull request Apr 3, 2023 that will close this issue
6 tasks
@github-actions
Copy link

This issue has become stale because it has been open 60 days with no activity. Adding the lifecycle/frozen label will exempt this issue from future lifecycle events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant