github.com/Finschia/finschia-sdk@v0.48.1/store/internal/maps/bench_test.go (about) 1 package maps 2 3 import "testing" 4 5 func BenchmarkKVPairBytes(b *testing.B) { 6 kvp := NewKVPair(make([]byte, 128), make([]byte, 1e6)) 7 b.ResetTimer() 8 b.ReportAllocs() 9 10 for i := 0; i < b.N; i++ { 11 b.SetBytes(int64(len(kvp.Bytes()))) 12 } 13 }