(b *testing.B)
| 1156 | } |
| 1157 | |
| 1158 | func BenchmarkInt_AsSlice(b *testing.B) { |
| 1159 | sizes := []int{10, 100, 1000} |
| 1160 | |
| 1161 | for _, size := range sizes { |
| 1162 | b.Run(fmt.Sprintf("%d", size), func(b *testing.B) { |
| 1163 | set := make(Int) |
| 1164 | for i := 0; i < size; i++ { |
| 1165 | set[int(i)] = struct{}{} |
| 1166 | } |
| 1167 | |
| 1168 | b.ReportAllocs() |
| 1169 | b.ResetTimer() |
| 1170 | for i := 0; i < b.N; i++ { |
| 1171 | _ = set.AsSlice() |
| 1172 | } |
| 1173 | }) |
| 1174 | } |
| 1175 | } |
| 1176 | |
| 1177 | func BenchmarkInt_FromSlice(b *testing.B) { |
| 1178 | sizes := []int{10, 100, 1000} |
nothing calls this directly
no test coverage detected
searching dependent graphs…