MCPcopy Index your code
hub / github.com/labstack/echo / BenchmarkServeHTTP_Store

Function BenchmarkServeHTTP_Store

perf_bench_test.go:85–93  ·  view source on GitHub ↗

Exercises a per-request Set (as request_id/auth middleware do), measuring the store-map reuse.

(b *testing.B)

Source from the content-addressed store, hash-verified

83
84// Exercises a per-request Set (as request_id/auth middleware do), measuring the store-map reuse.
85func 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
95func BenchmarkContext_GetSet(b *testing.B) {
96 e := New()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
benchServeFunction · 0.85
SetMethod · 0.80
NoContentMethod · 0.80
GETMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…