commit | a3421952acf1d6b060d2dd251463b1946732d6bb | [log] [tgz] |
---|---|---|
author | Herbie Ong <herbie@google.com> | Thu Mar 21 18:12:26 2019 -0700 |
committer | Herbie Ong <herbie@google.com> | Sat Mar 23 22:02:55 2019 +0000 |
tree | f459bb6bcc51752b7f96776c0361357bf4e117c2 | |
parent | f503c300f70e2aa8ab0749f0ea90f836f275f4a1 [diff] |
internal/encoding/json: improve decoding of JSON numbers for floats 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>
WARNING: This repository is in active development. There are no guarantees about API stability. Breaking changes will occur until a stable release is made and announced.
This repository is for the development of the next major Go implementation of protocol buffers. This library makes breaking API changes relative to the existing Go protobuf library. Of particular note, this API aims to make protobuf reflection a first-class feature of the API and implements the protobuf ecosystem in terms of reflection.
List of relevant design documents:
We appreciate community contributions. See CONTRIBUTING.md.
Issues regarding the new API can be filed at github.com/golang/protobuf. Please use a APIv2:
prefix in the title to make it clear that the issue is regarding the new API work.