============================================================================ Sample Benchmarks ============================================================================
(b *testing.B)
| 383 | // ============================================================================ |
| 384 | |
| 385 | func BenchmarkFory_Sample_Serialize(b *testing.B) { |
| 386 | f := newFory() |
| 387 | obj := CreateSample() |
| 388 | buf := fory.NewByteBuffer(make([]byte, 0, 512)) |
| 389 | |
| 390 | b.ResetTimer() |
| 391 | for i := 0; i < b.N; i++ { |
| 392 | buf.Reset() |
| 393 | err := f.SerializeTo(buf, &obj) |
| 394 | if err != nil { |
| 395 | b.Fatal(err) |
| 396 | } |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | func BenchmarkProtobuf_Sample_Serialize(b *testing.B) { |
| 401 | rejectNonForySchemaMismatch(b) |
nothing calls this directly
no test coverage detected