MCPcopy
hub / github.com/gin-gonic/gin / BenchmarkOneRouteString

Function BenchmarkOneRouteString

benchmarks_test.go:82–88  ·  view source on GitHub ↗
(B *testing.B)

Source from the content-addressed store, hash-verified

80}
81
82func BenchmarkOneRouteString(B *testing.B) {
83 router := New()
84 router.GET("/text", func(c *Context) {
85 c.String(http.StatusOK, "this is a plain text")
86 })
87 runRequest(B, router, http.MethodGet, "/text")
88}
89
90func BenchmarkManyRoutesFirst(B *testing.B) {
91 router := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
runRequestFunction · 0.85
GETMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected