protobuf-go/internal/encoding
Herbie Ong b02b6d1da5 internal/encoding/json: fix performance cliff when decoding large integers that will go out of range.
For large positive integers, add check for number of decimal digits
before converting number to plain integer w/o exponent.

If exponent value is large, previous implementation may end up
constructing a large string with lots of zeroes that is not useful as it
will fail later on when called with strconv.Parse{Uint,Int} anyways.

Fixes golang/protobuf#1002.

Change-Id: I65bfad304401e076743853d7501786b7231b083b
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/213717
Reviewed-by: Damien Neil <dneil@google.com>
2020-01-08 18:44:43 +00:00
..
defval all: use typed variant of protoreflect.ValueOf 2019-09-17 21:33:16 +00:00
json internal/encoding/json: fix performance cliff when decoding large integers that will go out of range. 2020-01-08 18:44:43 +00:00
messageset proto, internal/impl: store unknown MessageSet items in non-mset format 2019-11-11 19:40:27 +00:00
pack
tag internal/filedesc: use jsonName.Init method over JSONName constructor 2020-01-06 18:42:14 +00:00
text encoding/prototext: drop trailing newline for empty 2019-09-14 21:08:43 +00:00
wire all: don't allow invalid field numbers when legacy support is on 2019-12-09 18:35:13 +00:00