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

Function Benchmark_Route_Match_Root_Parallel

router_test.go:2310–2325  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

2308}
2309
2310func Benchmark_Route_Match_Root_Parallel(b *testing.B) {
2311 var match bool
2312 var params [maxParams]string
2313 parsed := parseRoute("/", regexp.MustCompile)
2314 route := &Route{use: false, root: true, star: false, path: "/", routeParser: parsed, Params: parsed.params, Path: "/", Method: "DELETE"}
2315 route.Handlers = append(route.Handlers, func(_ Ctx) error {
2316 return nil
2317 })
2318 b.RunParallel(func(pb *testing.PB) {
2319 for pb.Next() {
2320 match = route.match("/", "/", &params)
2321 }
2322 })
2323 require.True(b, match)
2324 require.Equal(b, []string{}, params[0:len(parsed.params)])
2325}
2326
2327func Benchmark_Router_Handler_CaseSensitive_Parallel(b *testing.B) {
2328 app := New()

Callers

nothing calls this directly

Calls 3

matchMethod · 0.95
parseRouteFunction · 0.85
NextMethod · 0.65

Tested by

no test coverage detected