protobuf-go/proto
Damien Neil b0d217f664 proto, internal/impl: don't create fast path Size for legacy Marshalers
Implementations of the legacy Marshaler type have no way to efficiently
compute the size of the message. Rather than generating an inefficient
fast-path Size method which marshals the message and examines the
length of the result, don't generate a fast-path at all.

Drop the requirement that a fast-path MarshalAppend requires a
corresponding Size.

Avoids O(N^2) behavior when marshaling a legacy Marshaler that
recursively calls proto.Marshal.

Change-Id: I4793cf32275d08f29c8e1a1a44a193d9a5724058
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/213443
Reviewed-by: Joe Tsai <joetsai@google.com>
2020-01-06 22:47:37 +00:00
..
bench_test.go proto: rearrange test messages 2019-12-16 21:49:56 +00:00
decode_gen.go proto: consistently use non-nil, zero-length []bytes for empty bytes strings 2019-12-09 17:33:50 +00:00
decode_test.go proto: distinguish between invalid and empty messages in Equal 2020-01-06 19:37:38 +00:00
decode.go proto, internal/impl: reject invalid field numbers in map items 2019-12-21 00:16:12 +00:00
doc.go
encode_gen.go
encode_test.go proto: distinguish between invalid and empty messages in Equal 2020-01-06 19:37:38 +00:00
encode.go proto, internal/impl: don't create fast path Size for legacy Marshalers 2020-01-06 22:47:37 +00:00
equal_test.go proto: distinguish between invalid and empty messages in Equal 2020-01-06 19:37:38 +00:00
equal.go proto: distinguish between invalid and empty messages in Equal 2020-01-06 19:37:38 +00:00
extension_test.go internal/protolegacy: add stub v1 proto package for testing purposes 2019-10-05 23:12:32 +00:00
extension.go
isinit_test.go proto, internal/impl: implement support for weak fields 2019-09-19 22:41:12 +00:00
isinit.go
merge_test.go proto: add MergeOptions.Shallow option 2020-01-06 20:26:20 +00:00
merge.go proto: add Clone function and MergeOptions.Clone method 2020-01-06 21:07:28 +00:00
messageset_test.go proto: rearrange test messages 2019-12-16 21:49:56 +00:00
messageset.go proto, internal/impl: store unknown MessageSet items in non-mset format 2019-11-11 19:40:27 +00:00
methods_test.go internal/impl: more checks for aberrant messages 2019-12-10 23:02:58 +00:00
noenforceutf8_test.go proto: rearrange test messages 2019-12-16 21:49:56 +00:00
proto_methods.go proto: reset message by default in Unmarshal 2019-09-17 21:13:42 +00:00
proto_reflect.go proto: reset message by default in Unmarshal 2019-09-17 21:13:42 +00:00
proto.go
reset_test.go
reset.go proto: reset message by default in Unmarshal 2019-09-17 21:13:42 +00:00
size_gen.go
size.go proto, internal/impl: don't create fast path Size for legacy Marshalers 2020-01-06 22:47:37 +00:00
testmessages_test.go proto, internal/impl: reject invalid field numbers in map items 2019-12-21 00:16:12 +00:00
weak_test.go internal/impl: weak field bugfixes 2019-10-04 17:07:45 +00:00
wrappers.go