mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-26 09:35:33 +00:00
a3421952ac
Per Joe's suggestion, remove producing numberParts when parsing a JSON number to produce corresponding Value. This saves having to store it inside Value as well. Only produce numberParts for calls to Value.{Int,Uint} call. numberParts is only used for producing integers and removing the logic to produce numberParts improves overall decoding speed for floats, and shows no change for integers. name old time/op new time/op delta Float-4 559ns ± 0% 288ns ± 0% ~ (p=1.000 n=1+1) Int-4 471ns ± 0% 466ns ± 0% ~ (p=1.000 n=1+1) Change-Id: I21bf304ca67dda8d41a4ea0022dcbefd51058c1c Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/168781 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>