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

Function BenchmarkSerializer_Deserialize

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

Source from the content-addressed store, hash-verified

42}
43
44func BenchmarkSerializer_Deserialize(b *testing.B) {
45 m := &Message{100, "hell world"}
46 s := NewSerializer()
47
48 d, err := s.Marshal(m)
49 if err != nil {
50 b.Error(err)
51 }
52
53 for i := 0; i < b.N; i++ {
54 m1 := &Message{}
55 if err := s.Unmarshal(d, m1); err != nil {
56 b.Fatalf("unmarshal failed: %v", err)
57 }
58 }
59}

Callers

nothing calls this directly

Calls 4

MarshalMethod · 0.95
UnmarshalMethod · 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…