Some checks are pending
docker-build-cometbft / vars (push) Waiting to run
docker-build-cometbft / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-cometbft / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-cometbft / merge-images (push) Blocked by required conditions
docker-build-e2e-node / vars (push) Waiting to run
docker-build-e2e-node / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-e2e-node / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-e2e-node / merge-images (push) Blocked by required conditions
24 lines
505 B
Go
24 lines
505 B
Go
package pex
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/cometbft/cometbft/p2p"
|
|
)
|
|
|
|
func BenchmarkAddrBook_hash(b *testing.B) {
|
|
book := &addrBook{
|
|
ourAddrs: make(map[string]struct{}),
|
|
privateIDs: make(map[p2p.ID]struct{}),
|
|
addrLookup: make(map[p2p.ID]*knownAddress),
|
|
badPeers: make(map[p2p.ID]*knownAddress),
|
|
filePath: "",
|
|
routabilityStrict: true,
|
|
}
|
|
book.init()
|
|
msg := []byte(`foobar`)
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
_, _ = book.hash(msg)
|
|
}
|
|
}
|