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

Function BenchmarkString_MarshalMsg

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

Source from the content-addressed store, hash-verified

449}
450
451func BenchmarkString_MarshalMsg(b *testing.B) {
452 sizes := []int{10, 100, 1000}
453
454 for _, size := range sizes {
455 b.Run(fmt.Sprintf("%d", size), func(b *testing.B) {
456 set := make(String)
457 for i := 0; i < size; i++ {
458 set[fmt.Sprintf("val%d", i)] = struct{}{}
459 }
460
461 b.ReportAllocs()
462 b.ResetTimer()
463 for i := 0; i < b.N; i++ {
464 _, err := set.MarshalMsg(nil)
465 if err != nil {
466 b.Fatal(err)
467 }
468 }
469 })
470 }
471}
472
473func BenchmarkString_UnmarshalMsg(b *testing.B) {
474 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…