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

Function BenchmarkInt_AsSlice

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

Source from the content-addressed store, hash-verified

1156}
1157
1158func 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
1177func BenchmarkInt_FromSlice(b *testing.B) {
1178 sizes := []int{10, 100, 1000}

Callers

nothing calls this directly

Calls 1

AsSliceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…