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

Function BenchmarkStringSorted_FromSlice

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

Source from the content-addressed store, hash-verified

652}
653
654func BenchmarkStringSorted_FromSlice(b *testing.B) {
655 sizes := []int{10, 100, 1000}
656
657 for _, size := range sizes {
658 b.Run(fmt.Sprintf("%d", size), func(b *testing.B) {
659 slice := make([]string, size)
660 for i := 0; i < size; i++ {
661 slice[i] = fmt.Sprintf("val%d", i)
662 }
663
664 b.ReportAllocs()
665 b.ResetTimer()
666 for i := 0; i < b.N; i++ {
667 _ = StringSortedFromSlice(slice)
668 }
669 })
670 }
671}
672
673func TestInt_RoundTrip(t *testing.T) {
674 set := make(Int)

Callers

nothing calls this directly

Calls 1

StringSortedFromSliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…