transaction: add benchmark for transaction serialization
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
b989504d74
commit
620295efe3
1 changed files with 11 additions and 0 deletions
|
@ -64,3 +64,14 @@ func BenchmarkTransaction_Bytes(b *testing.B) {
|
||||||
_ = tx.Bytes()
|
_ = tx.Bytes()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func BenchmarkGetVarSize(b *testing.B) {
|
||||||
|
tx, err := NewTransactionFromBytes(benchTx)
|
||||||
|
require.NoError(b, err)
|
||||||
|
|
||||||
|
b.ResetTimer()
|
||||||
|
b.ReportAllocs()
|
||||||
|
for i := 0; i < b.N; i++ {
|
||||||
|
_ = io.GetVarSize(tx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue