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
Support transient object store that caches interface{} instead of []byte.
Problem Definition
We have many GetParams calls, and although the store layer cached the raw bytes, we still have to do the decoding, which sometimes has non-trivial costs (e.g. in ethermint), and this cost happens multiple times for each transaction, for example, auth keeper's GetParams() is called multiple times in ante handlers, and when we have many transactions in a block, the accumulated cost is actually pretty significant, which is revealed by our profiling.
Proposed Feature
Add an object store type, and a different store interface that supports interface{} as value type instead of []byte.
Then we can cache the parameters very effectively since it's rarely updated, most of the time, we only need to load and decode once for each block.
There are also other things worthy to cache other than the parameters, actually most of the use cases for transient/memory stores should probably use an object store.
I don't know how we can approach this without touching storage layer, because we need to deal with branching stuff, and we also need it to store arbitrary objects that's not loaded from storage, it can for example used in fee collection.
Summary
Support transient object store that caches
interface{}
instead of[]byte
.Problem Definition
We have many
GetParams
calls, and although the store layer cached the raw bytes, we still have to do the decoding, which sometimes has non-trivial costs (e.g. in ethermint), and this cost happens multiple times for each transaction, for example, auth keeper'sGetParams()
is called multiple times in ante handlers, and when we have many transactions in a block, the accumulated cost is actually pretty significant, which is revealed by our profiling.Proposed Feature
Add an object store type, and a different store interface that supports
interface{}
as value type instead of[]byte
.Then we can cache the parameters very effectively since it's rarely updated, most of the time, we only need to load and decode once for each block.
There are also other things worthy to cache other than the parameters, actually most of the use cases for transient/memory stores should probably use an object store.
Implementation
crypto-org-chain#206
The text was updated successfully, but these errors were encountered: