aboutsummaryrefslogtreecommitdiff
path: root/header_timing_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'header_timing_test.go')
-rw-r--r--header_timing_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/header_timing_test.go b/header_timing_test.go
index 66698c4..90f65ae 100644
--- a/header_timing_test.go
+++ b/header_timing_test.go
@@ -180,6 +180,19 @@ func benchmarkNormalizeHeaderKey(b *testing.B, src []byte) {
})
}
+func BenchmarkVisitHeaderParams(b *testing.B) {
+ var h RequestHeader
+ h.SetBytesKV(strContentType, []byte(`text/plain ; foo=bar ; param2="dquote is: [\"], ok?" ; version=1; q=0.324 `))
+
+ header := h.ContentType()
+ b.ReportAllocs()
+ b.ResetTimer()
+
+ for n := 0; n < b.N; n++ {
+ VisitHeaderParams(header, func(key, value []byte) bool { return true })
+ }
+}
+
func BenchmarkRemoveNewLines(b *testing.B) {
type testcase struct {
value string