casper-network / casper-network/casper-node

Reduce amount of data copies across the global state storage

Open
#3,959 1 comment 0 reactions 1 assignee Claimed by @mpapierski View on GitHub
execution engine tech-debt
Dominant language
Rust
Stars
399
Forks
224
Avg merge
15h 44m
Merged PRs (30d)
2

Description

In the past there were some attempts at profiling the code and analysing the flamegraphs to look for inefficiencies. One of the visible issues were copies of data coming from lmdb: lmdb read gives you a slice of data -> we heap allocate and copy data -> we pass it just to consume it (and make additional copies internally, when need). We should do another pass, get a flamegraph that measures global state operations, and remove unnecessary allocations. Some StoredValues could get really big and cloning it may have impact on the speed.
One starting point is this line [https://github.com/casper-network/casper-node/blob/f9ed61b6492fab6c4979b9b73c460ed[…]fa60db2/execution_engine/src/storage/transaction_source/lmdb.rs](https://github.com/casper-network/casper-node/blob/f9ed61b6492fab6c4979b9b73c460ed84fa60db2/execution_engine/src/storage/transaction_source/lmdb.rs#L31) and we should follow the lead going deeper and looking at the flamegraphs. (This particular line was fixed in #2394 PR, but later reverted)
This is a follow up for a discussion that occurred while reviewing https://github.com/casper-network/casper-node/pull/3811

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.