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

Function Benchmark_Router_Handler_StrictRouting

router_test.go:1873–1887  ·  view source on GitHub ↗

go test -run=^$ -bench=Benchmark_Router_Handler_StrictRouting -benchmem -count=4

(b *testing.B)

Source from the content-addressed store, hash-verified

1871
1872// go test -run=^$ -bench=Benchmark_Router_Handler_StrictRouting -benchmem -count=4
1873func Benchmark_Router_Handler_StrictRouting(b *testing.B) {
1874 app := New()
1875 app.config.CaseSensitive = true
1876 registerDummyRoutes(app)
1877 appHandler := app.Handler()
1878
1879 c := &fasthttp.RequestCtx{}
1880
1881 c.Request.Header.SetMethod("DELETE")
1882 c.URI().SetPath("/user/keys/1337")
1883
1884 for b.Loop() {
1885 appHandler(c)
1886 }
1887}
1888
1889// go test -run=^$ -bench=Benchmark_Router_GitHub_API -benchmem -count=16
1890func Benchmark_Router_GitHub_API(b *testing.B) {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected