MCPcopy
hub / github.com/lonng/nano / BenchmarkSerializer_Serialize

Function BenchmarkSerializer_Serialize

serialize/json/json_test.go:31–42  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

29}
30
31func BenchmarkSerializer_Serialize(b *testing.B) {
32 m := &Message{100, "hell world"}
33 s := NewSerializer()
34
35 for i := 0; i < b.N; i++ {
36 if _, err := s.Marshal(m); err != nil {
37 b.Fatalf("unmarshal failed: %v", err)
38 }
39 }
40
41 b.ReportAllocs()
42}
43
44func BenchmarkSerializer_Deserialize(b *testing.B) {
45 m := &Message{100, "hell world"}

Callers

nothing calls this directly

Calls 3

MarshalMethod · 0.95
FatalfMethod · 0.80
NewSerializerFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…