mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-17 10:11:58 +00:00
fc5f8c340a
Suppose a oneof has N fields, the previous marshaling logic would traverse every field checking for presence. This is O(N). Using the protoreflect.Message.WhichOneof method, we can reduce this to O(1). This optimization is exceptionally useful for oneofs with a large number of fields. Change-Id: I5f4aa8b1a899930f5c95e9cf1d68bac4b0b7884d Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/196121 Reviewed-by: Herbie Ong <herbie@google.com> |
||
---|---|---|
.. | ||
decode_test.go | ||
decode.go | ||
doc.go | ||
encode_test.go | ||
encode.go | ||
other_test.go |