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

Function Benchmark_Router_WithCompression

router_test.go:1606–1626  ·  view source on GitHub ↗

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

(b *testing.B)

Source from the content-addressed store, hash-verified

1604
1605// go test -v ./... -run=^$ -bench=Benchmark_Router_WithCompression -benchmem -count=4
1606func Benchmark_Router_WithCompression(b *testing.B) {
1607 app := New()
1608 handler := func(c Ctx) error {
1609 return c.Next()
1610 }
1611 app.Get("/", handler)
1612 app.Get("/", handler)
1613 app.Get("/", handler)
1614 app.Get("/", handler)
1615 app.Get("/", handler)
1616 app.Get("/", handler)
1617
1618 appHandler := app.Handler()
1619 c := &fasthttp.RequestCtx{}
1620
1621 c.Request.Header.SetMethod(MethodGet)
1622 c.URI().SetPath("/")
1623 for b.Loop() {
1624 appHandler(c)
1625 }
1626}
1627
1628// go test -run=^$ -bench=Benchmark_Startup_Process -benchmem -count=9
1629func Benchmark_Startup_Process(b *testing.B) {

Callers

nothing calls this directly

Calls 7

HandlerMethod · 0.80
SetMethodMethod · 0.80
SetPathMethod · 0.80
URIMethod · 0.80
NewFunction · 0.70
NextMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected