Add a benchmark for TxSha.
This commit adds a benchmark for the TxSha function of a MsgTx.
This commit is contained in:
parent
0e1f6a6628
commit
2de1b73d12
1 changed files with 9 additions and 0 deletions
|
@ -281,3 +281,12 @@ func BenchmarkWriteBlockHeader(b *testing.B) {
|
|||
btcwire.TstWriteBlockHeader(ioutil.Discard, 0, &header)
|
||||
}
|
||||
}
|
||||
|
||||
// BenchmarkTxSha performs a benchmark on how long it takes to hash a
|
||||
// transaction.
|
||||
func BenchmarkTxSha(b *testing.B) {
|
||||
tx := btcwire.GenesisBlock.Transactions[0]
|
||||
for i := 0; i < b.N; i++ {
|
||||
tx.TxSha()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue