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

Function Benchmark_App_RebuildTree_Parallel

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

Source from the content-addressed store, hash-verified

2085}
2086
2087func Benchmark_App_RebuildTree_Parallel(b *testing.B) {
2088 b.ReportAllocs()
2089 b.ResetTimer()
2090 b.RunParallel(func(pb *testing.PB) {
2091 // Each worker gets its own App instance to avoid data races on shared state
2092 localApp := New()
2093 registerDummyRoutes(localApp)
2094 for pb.Next() {
2095 localApp.hasRoutesRefreshed = true
2096 localApp.RebuildTree()
2097 }
2098 })
2099}
2100
2101func Benchmark_App_MethodNotAllowed_Parallel(b *testing.B) {
2102 app := New()

Callers

nothing calls this directly

Calls 4

registerDummyRoutesFunction · 0.85
RebuildTreeMethod · 0.80
NewFunction · 0.70
NextMethod · 0.65

Tested by

no test coverage detected