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

Function Benchmark_Ctx_IP

ctx_test.go:3924–3934  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

3922}
3923
3924func Benchmark_Ctx_IP(b *testing.B) {
3925 app := New()
3926 c := app.AcquireCtx(&fasthttp.RequestCtx{})
3927 c.Request()
3928 var res string
3929 b.ReportAllocs()
3930 for b.Loop() {
3931 res = c.IP()
3932 }
3933 require.Equal(b, "0.0.0.0", res)
3934}
3935
3936func Benchmark_Ctx_IP_With_ProxyHeader_Chain(b *testing.B) {
3937 app := New(Config{

Callers

nothing calls this directly

Calls 4

AcquireCtxMethod · 0.80
NewFunction · 0.70
RequestMethod · 0.65
IPMethod · 0.65

Tested by

no test coverage detected