Exercises a per-request Set (as request_id/auth middleware do), measuring the store-map reuse.
(b *testing.B)
| 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) { |
| 86 | e := New() |
| 87 | e.GET("/", func(c *Context) error { |
| 88 | c.Set("user", "alice") |
| 89 | return c.NoContent(http.StatusOK) |
| 90 | }) |
| 91 | req := httptest.NewRequest(http.MethodGet, "/", nil) |
| 92 | benchServe(b, e, req) |
| 93 | } |
| 94 | |
| 95 | func BenchmarkContext_GetSet(b *testing.B) { |
| 96 | e := New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…