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

Function Benchmark_Router_Handler

router_test.go:1553–1566  ·  view source on GitHub ↗

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

(b *testing.B)

Source from the content-addressed store, hash-verified

1551
1552// go test -v ./... -run=^$ -bench=Benchmark_Router_Handler -benchmem -count=4
1553func Benchmark_Router_Handler(b *testing.B) {
1554 app := New()
1555 registerDummyRoutes(app)
1556 appHandler := app.Handler()
1557
1558 c := &fasthttp.RequestCtx{}
1559
1560 c.Request.Header.SetMethod("DELETE")
1561 c.URI().SetPath("/user/keys/1337")
1562
1563 for b.Loop() {
1564 appHandler(c)
1565 }
1566}
1567
1568func Benchmark_Router_Handler_Strict_Case(b *testing.B) {
1569 app := New(Config{

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…