MCPcopy Create free account
hub / github.com/BryanMwangi/pine / BenchmarkRouter_Search_Static

Function BenchmarkRouter_Search_Static

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

Source from the content-addressed store, hash-verified

325}
326
327func BenchmarkRouter_Search_Static(b *testing.B) {
328 r := newTestRouter()
329 for i := 0; i < 100; i++ {
330 insertRoute(r, "GET", fmt.Sprintf("/static/route/%d", i))
331 }
332 b.ResetTimer()
333 b.ReportAllocs()
334 for i := 0; i < b.N; i++ {
335 r.Search("GET", "/static/route/50")
336 }
337}
338
339func BenchmarkRouter_Search_Param(b *testing.B) {
340 r := newTestRouter()

Callers

nothing calls this directly

Calls 3

newTestRouterFunction · 0.85
insertRouteFunction · 0.85
SearchMethod · 0.80

Tested by

no test coverage detected