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

Function BenchmarkIntSorted_AsSlice

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

Source from the content-addressed store, hash-verified

1293}
1294
1295func BenchmarkIntSorted_AsSlice(b *testing.B) {
1296 sizes := []int{10, 100, 1000}
1297
1298 for _, size := range sizes {
1299 b.Run(fmt.Sprintf("%d", size), func(b *testing.B) {
1300 set := make(IntSorted)
1301 for i := 0; i < size; i++ {
1302 set[int(i)] = struct{}{}
1303 }
1304
1305 b.ReportAllocs()
1306 b.ResetTimer()
1307 for i := 0; i < b.N; i++ {
1308 _ = set.AsSlice()
1309 }
1310 })
1311 }
1312}
1313
1314func BenchmarkIntSorted_FromSlice(b *testing.B) {
1315 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…