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

Function Benchmark_Client_Request

client/client_test.go:2350–2369  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

2348}
2349
2350func Benchmark_Client_Request(b *testing.B) {
2351 app, dial, start := createHelperServer(b)
2352 app.Get("/", func(c fiber.Ctx) error {
2353 return c.SendString("hello world")
2354 })
2355
2356 go start()
2357
2358 client := New().SetDial(dial)
2359
2360 b.ReportAllocs()
2361
2362 var err error
2363 var resp *Response
2364 for b.Loop() {
2365 resp, err = client.Get("http://example.com")
2366 resp.Close()
2367 }
2368 require.NoError(b, err)
2369}
2370
2371func Benchmark_Client_Request_Parallel(b *testing.B) {
2372 app, dial, start := createHelperServer(b)

Callers

nothing calls this directly

Calls 6

CloseMethod · 0.95
createHelperServerFunction · 0.85
NewFunction · 0.70
GetMethod · 0.65
SendStringMethod · 0.65
SetDialMethod · 0.65

Tested by

no test coverage detected