MCPcopy
hub / github.com/gofiber/fiber / Benchmark_Router_Handler_Unescape

Function Benchmark_Router_Handler_Unescape

router_test.go:1851–1870  ·  view source on GitHub ↗

go test -v ./... -run=^$ -bench=Benchmark_Router_Handler_Unescape -benchmem -count=4

(b *testing.B)

Source from the content-addressed store, hash-verified

1849
1850// go test -v ./... -run=^$ -bench=Benchmark_Router_Handler_Unescape -benchmem -count=4
1851func Benchmark_Router_Handler_Unescape(b *testing.B) {
1852 app := New()
1853 app.config.UnescapePath = true
1854 registerDummyRoutes(app)
1855 app.Delete("/créer", func(_ Ctx) error {
1856 return nil
1857 })
1858
1859 appHandler := app.Handler()
1860
1861 c := &fasthttp.RequestCtx{}
1862
1863 c.Request.Header.SetMethod(MethodDelete)
1864 c.URI().SetPath("/cr%C3%A9er")
1865
1866 for b.Loop() {
1867 c.URI().SetPath("/cr%C3%A9er")
1868 appHandler(c)
1869 }
1870}
1871
1872// go test -run=^$ -bench=Benchmark_Router_Handler_StrictRouting -benchmem -count=4
1873func Benchmark_Router_Handler_StrictRouting(b *testing.B) {

Callers

nothing calls this directly

Calls 7

registerDummyRoutesFunction · 0.85
HandlerMethod · 0.80
SetMethodMethod · 0.80
SetPathMethod · 0.80
URIMethod · 0.80
NewFunction · 0.70
DeleteMethod · 0.65

Tested by

no test coverage detected