Skip to content

Commit

Permalink
perf: Remove telemetry from wrappings of store (backport #10077) (#10084
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mergify[bot] authored Sep 9, 2021
1 parent be188d0 commit f2917eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

### API Breaking Changes

* [\#10077](https://github.com/cosmos/cosmos-sdk/pull/10077) Remove telemetry on `GasKV` and `CacheKV` store Get/Set operations, significantly improving their performance.

## [v0.42.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.9) - 2021-08-04

### Bug Fixes
Expand Down
2 changes: 0 additions & 2 deletions store/cachekv/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func (store *Store) GetStoreType() types.StoreType {
func (store *Store) Get(key []byte) (value []byte) {
store.mtx.Lock()
defer store.mtx.Unlock()
defer telemetry.MeasureSince(time.Now(), "store", "cachekv", "get")

types.AssertValidKey(key)

Expand All @@ -74,7 +73,6 @@ func (store *Store) Get(key []byte) (value []byte) {
func (store *Store) Set(key []byte, value []byte) {
store.mtx.Lock()
defer store.mtx.Unlock()
defer telemetry.MeasureSince(time.Now(), "store", "cachekv", "set")

types.AssertValidKey(key)
types.AssertValidValue(value)
Expand Down
4 changes: 0 additions & 4 deletions store/gaskv/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ func (gs *Store) GetStoreType() types.StoreType {

// Implements KVStore.
func (gs *Store) Get(key []byte) (value []byte) {
defer telemetry.MeasureSince(time.Now(), "store", "gaskv", "get")

gs.gasMeter.ConsumeGas(gs.gasConfig.ReadCostFlat, types.GasReadCostFlatDesc)
value = gs.parent.Get(key)

Expand All @@ -48,8 +46,6 @@ func (gs *Store) Get(key []byte) (value []byte) {

// Implements KVStore.
func (gs *Store) Set(key []byte, value []byte) {
defer telemetry.MeasureSince(time.Now(), "store", "gaskv", "set")

types.AssertValidKey(key)
types.AssertValidValue(value)
gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostFlat, types.GasWriteCostFlatDesc)
Expand Down

0 comments on commit f2917eb

Please sign in to comment.