-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
store benchmarks #11444
Comments
@robert-zaremba instead of doing benchmarks without the iavl cache, we should benchmark them against each other directly. Otherwise, we hobble iavl performance and the comparison is invalid |
@faddat , the goal is to test without a cache. store/v2 doesn't have a cache layer yet, so we would like to see a raw performance comparison of store/v1 vs store/v2 without a cache. |
@robert-zaremba @roysc Can we add benchmarks for database size? |
@roysc we may want to move #11328 (comment) here to keep things in one place. |
To simplify things I will summarize here the results from the same data used in #11328 (comment), which contains analysis. Each case is run on a store pre-filled with 100,000 entries. Keys are all 32 random bytes (generated as SHA256 sum of varint-encoded sequential integers):
Flame chart for v1, showing both Get and Set consist of recursive calls to access the tree: And for v2, showing the majority of time is spent accessing the DB: |
We have a new SMT implementation in progress at vulcanize/smt#5. Preliminary benchmark results show a significant improvement. Like the IAVL tree, this SMT only writes to the DB on commit, and caches the current state as an actual node tree, hence inserts are much faster. Reads are faster mainly because value storage has been moved out of the SMT object, allowing us to index by raw key (rather than hashed). v1 vs. new v2:
Old v2 vs new v2:
|
Out of curiosity does this new implementation produce the same trees as the old smt (e.g. including all subtrees with the same empty value are replaced by a placeholder)? |
@musalbas yes, identical hashes |
Nice. Regarding the DeepSubTree feature, I assume you removed that for the time being as it required extra work in order to make it compatible with the new lazy implementation, and this wasn't used in cosmos-sdk? This is needed to enable state transition fraud proofs for Cosmos SDK rollups that we're implementing. If there's no inherent reason why it wouldn't be possible to re-implement that with the new lazy implementation, then we (Celestia) would be interested in pursuing that, if we upstream the efficiency improvements in the lazy implementation to our fork. |
Right, it just wasn't relevant for this scope of work. |
closing this as its being handled though other issues ref #17580 |
Summary
We need a set of benchmark to correctly measure performance and detect inefficiencies in store/v2 design and implementation.
Meta issue to collect tasks for benchmarks we want to code.
Proposal
General approach
Get
oriented benchmarksin the setup we should store millions of records. We should deterministically query the store with keys which we expect there and keys we don't expect. We should have following setups
Expectation:
Set
oriented benchmarkCreate a deterministic scenario with only Set operations.
Set
will do 2 operations is store/v2: saving in SMT (will require traversing the tree an doing path update) and one direct update for State Store. IAVL, is doing tree rebalance and Merkle Path update - so similar amount of operations to store/v2.DB transactions
For Admin Use
The text was updated successfully, but these errors were encountered: