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

Function BenchmarkProtobuf_Sample_Serialize

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

Source from the content-addressed store, hash-verified

398}
399
400func BenchmarkProtobuf_Sample_Serialize(b *testing.B) {
401 rejectNonForySchemaMismatch(b)
402 obj := CreateSample()
403
404 b.ResetTimer()
405 for i := 0; i < b.N; i++ {
406 pbObj := ToPbSample(obj)
407 _, err := proto.Marshal(pbObj)
408 if err != nil {
409 b.Fatal(err)
410 }
411 }
412}
413
414func BenchmarkMsgpack_Sample_Serialize(b *testing.B) {
415 rejectNonForySchemaMismatch(b)

Callers

nothing calls this directly

Calls 4

CreateSampleFunction · 0.85
ToPbSampleFunction · 0.85
MarshalMethod · 0.80

Tested by

no test coverage detected