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

Function BenchmarkFory_SampleList_Serialize

benchmarks/go/benchmark_test.go:506–519  ·  view source on GitHub ↗

============================================================================ SampleList Benchmarks ============================================================================

(b *testing.B)

Source from the content-addressed store, hash-verified

504// ============================================================================
505
506func BenchmarkFory_SampleList_Serialize(b *testing.B) {
507 f := newFory()
508 obj := CreateSampleList()
509 buf := fory.NewByteBuffer(make([]byte, 0, 131072))
510
511 b.ResetTimer()
512 for i := 0; i < b.N; i++ {
513 buf.Reset()
514 err := f.SerializeTo(buf, &obj)
515 if err != nil {
516 b.Fatal(err)
517 }
518 }
519}
520
521func BenchmarkProtobuf_SampleList_Serialize(b *testing.B) {
522 rejectNonForySchemaMismatch(b)

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected