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

Function BenchmarkRouter_Insert

router_test.go:317–325  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Benchmarks ---------------------------------------------------------------------------

(b *testing.B)

Source from the content-addressed store, hash-verified

315// ---------------------------------------------------------------------------
316
317func BenchmarkRouter_Insert(b *testing.B) {
318 b.ReportAllocs()
319 for i := 0; i < b.N; i++ {
320 r := newTestRouter()
321 for j := 0; j < 100; j++ {
322 r.Insert("GET", fmt.Sprintf("/route/%d", j), []Handler{func(c *Ctx) error { return nil }})
323 }
324 }
325}
326
327func BenchmarkRouter_Search_Static(b *testing.B) {
328 r := newTestRouter()

Callers

nothing calls this directly

Calls 2

newTestRouterFunction · 0.85
InsertMethod · 0.80

Tested by

no test coverage detected