(b *testing.B)
| 1175 | } |
| 1176 | |
| 1177 | func BenchmarkInt_FromSlice(b *testing.B) { |
| 1178 | sizes := []int{10, 100, 1000} |
| 1179 | |
| 1180 | for _, size := range sizes { |
| 1181 | b.Run(fmt.Sprintf("%d", size), func(b *testing.B) { |
| 1182 | slice := make([]int, size) |
| 1183 | for i := 0; i < size; i++ { |
| 1184 | slice[i] = int(i) |
| 1185 | } |
| 1186 | |
| 1187 | b.ReportAllocs() |
| 1188 | b.ResetTimer() |
| 1189 | for i := 0; i < b.N; i++ { |
| 1190 | _ = IntFromSlice(slice) |
| 1191 | } |
| 1192 | }) |
| 1193 | } |
| 1194 | } |
| 1195 | |
| 1196 | func BenchmarkIntSorted_EncodeMsg(b *testing.B) { |
| 1197 | sizes := []int{10, 100, 1000} |
nothing calls this directly
no test coverage detected
searching dependent graphs…