commit | 8fa64d98d8d5979e4f4153fe5ffed0ac0bd677e7 | [log] [tgz] |
---|---|---|
author | Herbie Ong <[email protected]> | Fri Apr 05 20:45:07 2019 -0700 |
committer | Herbie Ong <[email protected]> | Sat Apr 06 04:16:05 2019 +0000 |
tree | f05d89e32044290860002f83cc0978263da1e1e8 | |
parent | 4686e239b6fbbd3c62d531f58cf05a3e9655c5a0 [diff] |
internal/encoding/json: improve Value.Int,Uint by reducing allocations parseNumber does not need to construct new slices for numberParts, it simply needs to reference the correct subset from the input. normalizeToString may need to allocate but only if there's a positive exponent. name old time/op new time/op delta Float-4 308ns ± 0% 291ns ± 0% ~ (p=1.000 n=1+1) Int-4 498ns ± 0% 341ns ± 0% ~ (p=1.000 n=1+1) String-4 262ns ± 0% 250ns ± 0% ~ (p=1.000 n=1+1) Bool-4 212ns ± 0% 210ns ± 0% ~ (p=1.000 n=1+1) name old alloc/op new alloc/op delta Float-4 48.0B ± 0% 48.0B ± 0% ~ (all equal) Int-4 160B ± 0% 99B ± 0% ~ (p=1.000 n=1+1) String-4 176B ± 0% 176B ± 0% ~ (all equal) Bool-4 0.00B 0.00B ~ (all equal) name old allocs/op new allocs/op delta Float-4 1.00 ± 0% 1.00 ± 0% ~ (all equal) Int-4 9.00 ± 0% 4.00 ± 0% ~ (p=1.000 n=1+1) String-4 3.00 ± 0% 3.00 ± 0% ~ (all equal) Bool-4 0.00 0.00 ~ (all equal) Change-Id: If083e18a5914b15e794d34722cbb6539cbd73a53 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/170788 Reviewed-by: Joe Tsai <[email protected]>
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.