Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add benchmark for component validation
  • Loading branch information
MarcoPolo committed Feb 6, 2025
commit ea5f441c63c2615f416e25ca8d9fb117e300117f
14 changes: 14 additions & 0 deletions multiaddr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,3 +1132,17 @@ func FuzzSplitRoundtrip(f *testing.F) {
}
})
}

func BenchmarkComponentValidation(b *testing.B) {
comp, err := NewComponent("ip4", "127.0.0.1")
if err != nil {
b.Fatal(err)
}
b.ReportAllocs()
for i := 0; i < b.N; i++ {
_, err := validateComponent(comp)
if err != nil {
b.Fatal(err)
}
}
}