(b *testing.B)
| 49 | } |
| 50 | |
| 51 | func BenchmarkAllocJSON(b *testing.B) { |
| 52 | e := New() |
| 53 | e.Logger = slog.New(slog.DiscardHandler) |
| 54 | req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(userJSON)) |
| 55 | rec := httptest.NewRecorder() |
| 56 | c := e.NewContext(req, rec) |
| 57 | |
| 58 | b.ResetTimer() |
| 59 | b.ReportAllocs() |
| 60 | |
| 61 | for i := 0; i < b.N; i++ { |
| 62 | c.JSON(http.StatusOK, testUser) |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | func BenchmarkAllocXML(b *testing.B) { |
| 67 | e := New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…