MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / BenchmarkHashBalanceIDVaried

Function BenchmarkHashBalanceIDVaried

transaction_benchmark_test.go:254–264  ·  view source on GitHub ↗

BenchmarkHashBalanceIDVaried measures hashing with different balance IDs

(b *testing.B)

Source from the content-addressed store, hash-verified

252
253// BenchmarkHashBalanceIDVaried measures hashing with different balance IDs
254func BenchmarkHashBalanceIDVaried(b *testing.B) {
255 balanceIDs := make([]string, 1000)
256 for i := 0; i < 1000; i++ {
257 balanceIDs[i] = fmt.Sprintf("bln_%d", i)
258 }
259
260 b.ResetTimer()
261 for i := 0; i < b.N; i++ {
262 _ = hashBalanceID(balanceIDs[i%1000])
263 }
264}
265
266// BenchmarkTransactionHashTxn measures transaction hash generation
267func BenchmarkTransactionHashTxn(b *testing.B) {

Callers

nothing calls this directly

Calls 1

hashBalanceIDFunction · 0.85

Tested by

no test coverage detected