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

Function BenchmarkStringSorted_AsSlice

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

Source from the content-addressed store, hash-verified

633}
634
635func BenchmarkStringSorted_AsSlice(b *testing.B) {
636 sizes := []int{10, 100, 1000}
637
638 for _, size := range sizes {
639 b.Run(fmt.Sprintf("%d", size), func(b *testing.B) {
640 set := make(StringSorted)
641 for i := 0; i < size; i++ {
642 set[fmt.Sprintf("val%d", i)] = struct{}{}
643 }
644
645 b.ReportAllocs()
646 b.ResetTimer()
647 for i := 0; i < b.N; i++ {
648 _ = set.AsSlice()
649 }
650 })
651 }
652}
653
654func BenchmarkStringSorted_FromSlice(b *testing.B) {
655 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…