encoding: add simple benchmarks to compare V1 vs V2

name          old time/op    new time/op     delta
TextEncode-4    7.70ms ± 2%    18.57ms ± 3%    +141.06%  (p=0.000 n=10+9)
TextDecode-4    9.62ms ± 6%   252.85ms ±10%   +2529.10%  (p=0.000 n=10+10)
JSONEncode-4    30.3ms ± 0%     10.7ms ± 7%     -64.80%  (p=0.000 n=9+9)
JSONDecode-4    54.1ms ± 0%    880.1ms ± 3%   +1526.65%  (p=0.000 n=9+10)

name          old alloc/op   new alloc/op    delta
TextEncode-4    3.98MB ± 0%    28.90MB ± 0%    +626.36%  (p=0.000 n=10+10)
TextDecode-4    2.74MB ± 0%  1158.24MB ± 0%  +42114.16%  (p=0.000 n=10+8)
JSONEncode-4    10.3MB ± 0%      3.9MB ± 0%     -61.74%  (p=0.000 n=10+9)
JSONDecode-4    19.0MB ± 0%   3349.9MB ± 0%  +17534.57%  (p=0.000 n=10+10)

name          old allocs/op  new allocs/op   delta
TextEncode-4     43.9k ± 0%      73.5k ± 0%     +67.53%  (p=0.000 n=10+10)
TextDecode-4     56.2k ± 0%     277.1k ± 0%    +393.31%  (p=0.000 n=8+8)
JSONEncode-4      465k ± 0%        64k ± 0%     -86.30%  (p=0.000 n=10+10)
JSONDecode-4      289k ± 0%       247k ± 0%     -14.58%  (p=0.000 n=10+10)

Change-Id: I593a52445b6356eec1488236d5f1f1a8c4b62cb3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/172137
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
1 file changed
tree: 4f4ba3841332a2238dd459b9762c5a8cce955026
  1. cmd/
  2. encoding/
  3. internal/
  4. proto/
  5. protogen/
  6. reflect/
  7. runtime/
  8. types/
  9. .gitignore
  10. .travis.yml
  11. AUTHORS
  12. CONTRIBUTING.md
  13. CONTRIBUTORS
  14. go.mod
  15. go.sum
  16. integration_test.go
  17. LICENSE
  18. PATENTS
  19. README.md
  20. regenerate.bash
  21. test.bash
README.md

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.