MCPcopy Create free account
hub / github.com/frain-dev/convoy / BenchmarkEncodeMsgPackLarge

Function BenchmarkEncodeMsgPackLarge

pkg/msgpack/msgpack_test.go:167–183  ·  view source on GitHub ↗

BenchmarkEncodeMsgPackLarge benchmarks encoding with large payloads (similar to production)

(b *testing.B)

Source from the content-addressed store, hash-verified

165
166// BenchmarkEncodeMsgPackLarge benchmarks encoding with large payloads (similar to production)
167func BenchmarkEncodeMsgPackLarge(b *testing.B) {
168 type payload struct {
169 Data string `json:"data"`
170 }
171
172 p := payload{
173 Data: string(bytes.Repeat([]byte("x"), 629*1024)), // 629KB payload (production size)
174 }
175
176 b.ResetTimer()
177 for i := 0; i < b.N; i++ {
178 _, err := EncodeMsgPack(p)
179 if err != nil {
180 b.Fatal(err)
181 }
182 }
183}

Callers

nothing calls this directly

Calls 2

EncodeMsgPackFunction · 0.85
FatalMethod · 0.65

Tested by

no test coverage detected