BenchmarkEncodeMsgPackLarge benchmarks encoding with large payloads (similar to production)
(b *testing.B)
| 165 | |
| 166 | // BenchmarkEncodeMsgPackLarge benchmarks encoding with large payloads (similar to production) |
| 167 | func 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 | } |
nothing calls this directly
no test coverage detected