diff --git a/pkg/core/transaction/bench_test.go b/pkg/core/transaction/bench_test.go index 991d729dc..763637680 100644 --- a/pkg/core/transaction/bench_test.go +++ b/pkg/core/transaction/bench_test.go @@ -64,3 +64,14 @@ func BenchmarkTransaction_Bytes(b *testing.B) { _ = 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) + } +}