Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

addrsmanager: extract out addressing logic from basichost #3075

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
14 changes: 14 additions & 0 deletions libp2p_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,3 +811,17 @@ func TestCustomTCPDialer(t *testing.T) {
})
require.ErrorContains(t, err, expectedErr.Error())
}

func BenchmarkAllAddrs(b *testing.B) {
h, err := New()

addrsHost := h.(interface{ AllAddrs() []ma.Multiaddr })
require.NoError(b, err)
defer h.Close()

b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
addrsHost.AllAddrs()
}
}
Loading
Loading