-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Analyze and improve store/v2 performance #11328
Comments
Added references to child issues: |
AnalysisBoth reads and updates are overall significantly slower for the SMT-based stores vs. IAVL. Using In this suite we test pure Comparison of benchmarks run on v1 ("old time") and v2 ("new time") using benchstat
ReadsOne of the motivations of ADR-40 was to improve performance by introducing a store design that required no tree traversal on reads. The Factors to note:
The effect of this design difference on performance is made clear in cases where IAVL does not cache nodes, which includes the We can highlight the difference even more by reloading the store before testing - now,
WritesThe difference in performance for updates in
NotesThese benchmarks were run on this branch, which is rebased on the latest v2/Multistore code: https://github.com/vulcanize/cosmos-sdk/tree/roysc/store_benchmarks/store. I can provide more data or info as needed. |
The aforementioned cache wrap for the SMT: https://github.com/vulcanize/smt/blob/cache_listener_wrap/cache_wrapped_mapstore.go (note - branch at https://github.com/roysc/smt/tree/cache_wrap patched to work with benchmarks - Roy) Note that we need this for ADR-052 so performance was not the main motivation for the cache wrap (but it is nice to see that it not only didn't have a negative impact, but a slightly positive one :D). The reason the impact is not more significant is because we are already doing caching at the DB transaction level (since, in the case of the SDK, the It should also be noted that the SMT implementation maintains its own mapping of |
Summary
Analyze the performance in store/v2
MultiStore
andsmt.Store
, and identify the causes of inefficiencies and bottlenecks, and resolve them.Problem Definition
According to the store benchmarks, the v2 MultiStore is performing slower than the existing IAVL-based MultiStore. Performance was one of the main concerns motivating ADR-40, so it's essential that we find a way to improve on this.
Proposal
For Admin Use
The text was updated successfully, but these errors were encountered: