From f2917ebb5f0b2b3ea34bcd243b6c1faffffdb253 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 9 Sep 2021 12:40:16 -0400 Subject: [PATCH] perf: Remove telemetry from wrappings of store (backport #10077) (#10084) --- CHANGELOG.md | 4 ++++ store/cachekv/store.go | 2 -- store/gaskv/store.go | 4 ---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8823a046e2c5..9aac0407f8a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/store/cachekv/store.go b/store/cachekv/store.go index cd7087c5dc7b..f978c23bd5e3 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -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) @@ -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) diff --git a/store/gaskv/store.go b/store/gaskv/store.go index 06b55f5ead48..812d08972011 100644 --- a/store/gaskv/store.go +++ b/store/gaskv/store.go @@ -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) @@ -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)