(b *testing.B)
| 83 | } |
| 84 | |
| 85 | func BenchmarkCodeEncoder(b *testing.B) { |
| 86 | b.ReportAllocs() |
| 87 | if codeJSON == nil { |
| 88 | b.StopTimer() |
| 89 | codeInit() |
| 90 | b.StartTimer() |
| 91 | } |
| 92 | b.RunParallel(func(pb *testing.PB) { |
| 93 | enc := NewEncoder(io.Discard) |
| 94 | for pb.Next() { |
| 95 | if err := enc.Encode(&codeStruct); err != nil { |
| 96 | b.Fatal("Encode:", err) |
| 97 | } |
| 98 | } |
| 99 | }) |
| 100 | b.SetBytes(int64(len(codeJSON))) |
| 101 | } |
| 102 | |
| 103 | func BenchmarkCodeMarshal(b *testing.B) { |
| 104 | b.ReportAllocs() |
nothing calls this directly
no test coverage detected
searching dependent graphs…