protobuf-go/encoding/prototext
Joe Tsai fc5f8c340a encoding: optimize for oneofs
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>
2019-09-19 18:20:38 +00:00
..
decode_test.go encoding/prototext: add UnmarshalOptions.DiscardUnknown 2019-09-17 03:07:37 +00:00
decode.go all: use typed variant of protoreflect.ValueOf 2019-09-17 21:33:16 +00:00
doc.go protogen, encoding/jsonpb, encoding/textpb: rename packages 2019-05-14 20:33:22 +00:00
encode_test.go encoding/prototext: add MarshalOptions.EmitUnknown 2019-09-17 02:56:29 +00:00
encode.go encoding: optimize for oneofs 2019-09-19 18:20:38 +00:00
other_test.go proto: move T->*T wrappers from internal/scalar to proto 2019-07-12 17:35:01 +00:00