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 <thebrokentoaster@gmail.com>
Next Generation Go Protocol Buffers
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.
Design Documents
List of relevant design documents:
Contributing
We appreciate community contributions. See CONTRIBUTING.md.
Reporting Issues
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.