MCPcopy
hub / github.com/gofiber/fiber / Benchmark_normalizeSchemeHost

Function Benchmark_normalizeSchemeHost

internal/schemehost/schemehost_test.go:122–138  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

120}
121
122func Benchmark_normalizeSchemeHost(b *testing.B) {
123 cases := []struct{ name, scheme, host string }{
124 {"noport", "https", "example.com"},
125 {"port", "https", "example.com:8080"},
126 {"ipv4", "https", "192.168.0.1"},
127 }
128 for _, tc := range cases {
129 b.Run(tc.name, func(b *testing.B) {
130 b.ReportAllocs()
131 var s string
132 for b.Loop() {
133 s = normalizeSchemeHost(tc.scheme, tc.host)
134 }
135 _ = s
136 })
137 }
138}
139
140func Benchmark_Match(b *testing.B) {
141 b.ReportAllocs()

Callers

nothing calls this directly

Calls 1

normalizeSchemeHostFunction · 0.85

Tested by

no test coverage detected