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

Function BenchmarkFory_MediaContent_Serialize

benchmarks/go/benchmark_test.go:627–640  ·  view source on GitHub ↗

============================================================================ MediaContent Benchmarks ============================================================================

(b *testing.B)

Source from the content-addressed store, hash-verified

625// ============================================================================
626
627func BenchmarkFory_MediaContent_Serialize(b *testing.B) {
628 f := newFory()
629 obj := CreateMediaContent()
630 buf := fory.NewByteBuffer(make([]byte, 0, 512))
631
632 b.ResetTimer()
633 for i := 0; i < b.N; i++ {
634 buf.Reset()
635 err := f.SerializeTo(buf, &obj)
636 if err != nil {
637 b.Fatal(err)
638 }
639 }
640}
641
642func BenchmarkProtobuf_MediaContent_Serialize(b *testing.B) {
643 rejectNonForySchemaMismatch(b)

Callers

nothing calls this directly

Calls 4

ResetMethod · 0.95
CreateMediaContentFunction · 0.85
SerializeToMethod · 0.80
newForyFunction · 0.70

Tested by

no test coverage detected