(b *testing.B)
| 156 | } |
| 157 | |
| 158 | func BenchmarkLogLineToTextFromSet(b *testing.B) { |
| 159 | nset := []int{1, 5, 50, 100, 254} |
| 160 | for _, nset := range nset { |
| 161 | b.Run(fmt.Sprintf("set=%d", nset), func(b *testing.B) { |
| 162 | ll := baker.LogLine{FieldSeparator: baker.DefaultLogLineFieldSeparator} |
| 163 | for i := 0; i < nset; i++ { |
| 164 | ll.Set(baker.FieldIndex(i), []byte("xxxxxxxxxx")) |
| 165 | } |
| 166 | |
| 167 | b.ReportAllocs() |
| 168 | b.ResetTimer() |
| 169 | for n := 0; n < b.N; n++ { |
| 170 | _ = ll.ToText(nil) |
| 171 | } |
| 172 | }) |
| 173 | } |
| 174 | } |
| 175 | func BenchmarkLogLineToTextFromParse(b *testing.B) { |
| 176 | fields := make([][]byte, 0, baker.LogLineNumFields) |
| 177 | for i := 0; i < int(baker.LogLineNumFields); i++ { |
nothing calls this directly
no test coverage detected