mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
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)
|
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…
Add table
Reference in a new issue