(b *testing.B)
| 69 | } |
| 70 | |
| 71 | func BenchmarkServeHTTP_JSON(b *testing.B) { |
| 72 | e := New() |
| 73 | type payload struct { |
| 74 | ID int `json:"id"` |
| 75 | Name string `json:"name"` |
| 76 | Tags []string |
| 77 | } |
| 78 | p := payload{ID: 1, Name: "Jon Snow", Tags: []string{"a", "b", "c"}} |
| 79 | e.GET("/", func(c *Context) error { return c.JSON(http.StatusOK, p) }) |
| 80 | req := httptest.NewRequest(http.MethodGet, "/", nil) |
| 81 | benchServe(b, e, req) |
| 82 | } |
| 83 | |
| 84 | // Exercises a per-request Set (as request_id/auth middleware do), measuring the store-map reuse. |
| 85 | func BenchmarkServeHTTP_Store(b *testing.B) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…