MCPcopy
hub / github.com/golang/protobuf / benchmarkBufferMarshal

Function benchmarkBufferMarshal

proto/proto_test.go:2244–2251  ·  view source on GitHub ↗
(b *testing.B, pb proto.Message)

Source from the content-addressed store, hash-verified

2242}
2243
2244func benchmarkBufferMarshal(b *testing.B, pb proto.Message) {
2245 p := proto.NewBuffer(nil)
2246 benchmarkMarshal(b, pb, func(pb0 proto.Message) ([]byte, error) {
2247 p.Reset()
2248 err := p.Marshal(pb0)
2249 return p.Bytes(), err
2250 })
2251}
2252
2253func benchmarkSize(b *testing.B, pb proto.Message) {
2254 benchmarkMarshal(b, pb, func(pb0 proto.Message) ([]byte, error) {

Callers

nothing calls this directly

Calls 5

ResetMethod · 0.95
MarshalMethod · 0.95
BytesMethod · 0.95
NewBufferFunction · 0.92
benchmarkMarshalFunction · 0.85

Tested by

no test coverage detected