MCPcopy
hub / github.com/tinylib/msgp / BenchmarkInt_FromSlice

Function BenchmarkInt_FromSlice

msgp/setof/generated_test.go:1177–1194  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1175}
1176
1177func 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
1196func BenchmarkIntSorted_EncodeMsg(b *testing.B) {
1197 sizes := []int{10, 100, 1000}

Callers

nothing calls this directly

Calls 1

IntFromSliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…