MCPcopy Index your code
hub / github.com/tinylib/msgp / BenchmarkStringSorted_MarshalMsg

Function BenchmarkStringSorted_MarshalMsg

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

Source from the content-addressed store, hash-verified

586}
587
588func BenchmarkStringSorted_MarshalMsg(b *testing.B) {
589 sizes := []int{10, 100, 1000}
590
591 for _, size := range sizes {
592 b.Run(fmt.Sprintf("%d", size), func(b *testing.B) {
593 set := make(StringSorted)
594 for i := 0; i < size; i++ {
595 set[fmt.Sprintf("val%d", i)] = struct{}{}
596 }
597
598 b.ReportAllocs()
599 b.ResetTimer()
600 for i := 0; i < b.N; i++ {
601 _, err := set.MarshalMsg(nil)
602 if err != nil {
603 b.Fatal(err)
604 }
605 }
606 })
607 }
608}
609
610func BenchmarkStringSorted_UnmarshalMsg(b *testing.B) {
611 sizes := []int{10, 100, 1000}

Callers

nothing calls this directly

Calls 1

MarshalMsgMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…