MCPcopy
hub / github.com/labstack/echo / BenchmarkAllocXML

Function BenchmarkAllocXML

context_test.go:66–79  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

64}
65
66func BenchmarkAllocXML(b *testing.B) {
67 e := New()
68 e.Logger = slog.New(slog.DiscardHandler)
69 req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(userJSON))
70 rec := httptest.NewRecorder()
71 c := e.NewContext(req, rec)
72
73 b.ResetTimer()
74 b.ReportAllocs()
75
76 for i := 0; i < b.N; i++ {
77 c.XML(http.StatusOK, testUser)
78 }
79}
80
81func BenchmarkRealIPForHeaderXForwardFor(b *testing.B) {
82 c := Context{request: &http.Request{

Callers

nothing calls this directly

Calls 3

XMLMethod · 0.95
NewFunction · 0.85
NewContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…