(b *testing.B)
| 130 | } |
| 131 | |
| 132 | func BenchmarkBind_Query(b *testing.B) { |
| 133 | e := New() |
| 134 | e.GET("/", func(c *Context) error { |
| 135 | var t bindTarget |
| 136 | return c.Bind(&t) |
| 137 | }) |
| 138 | b.ReportAllocs() |
| 139 | b.ResetTimer() |
| 140 | w := &nopResponseWriter{} |
| 141 | req := httptest.NewRequest(http.MethodGet, "/?id=1&name=Jon&email=jon@x.io&age=24&active=true", nil) |
| 142 | for i := 0; i < b.N; i++ { |
| 143 | w.h = nil |
| 144 | e.ServeHTTP(w, req) |
| 145 | } |
| 146 | } |