MCPcopy Create free account
hub / github.com/apache/fory / BenchmarkProtobuf_MediaContent_Serialize

Function BenchmarkProtobuf_MediaContent_Serialize

benchmarks/go/benchmark_test.go:642–654  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

640}
641
642func BenchmarkProtobuf_MediaContent_Serialize(b *testing.B) {
643 rejectNonForySchemaMismatch(b)
644 obj := CreateMediaContent()
645
646 b.ResetTimer()
647 for i := 0; i < b.N; i++ {
648 pbObj := ToPbMediaContent(obj)
649 _, err := proto.Marshal(pbObj)
650 if err != nil {
651 b.Fatal(err)
652 }
653 }
654}
655
656func BenchmarkMsgpack_MediaContent_Serialize(b *testing.B) {
657 rejectNonForySchemaMismatch(b)

Callers

nothing calls this directly

Calls 4

CreateMediaContentFunction · 0.85
ToPbMediaContentFunction · 0.85
MarshalMethod · 0.80

Tested by

no test coverage detected