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

Function BenchmarkOneRouteHTML

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

Source from the content-addressed store, hash-verified

60}
61
62func BenchmarkOneRouteHTML(B *testing.B) {
63 router := New()
64 t := template.Must(template.New("index").Parse(`
65 <html><body><h1>{{.}}</h1></body></html>`))
66 router.SetHTMLTemplate(t)
67
68 router.GET("/html", func(c *Context) {
69 c.HTML(http.StatusOK, "index", "hola")
70 })
71 runRequest(B, router, http.MethodGet, "/html")
72}
73
74func BenchmarkOneRouteSet(B *testing.B) {
75 router := New()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
runRequestFunction · 0.85
SetHTMLTemplateMethod · 0.80
HTMLMethod · 0.80
GETMethod · 0.65

Tested by

no test coverage detected