Add sparse enum decoding benchmarks

With upcoming change we'll improve decoding performance of enums, but
there will be a difference between "sparse" and "dense" enum decoding
performance even though they'll both be faster.

To be able to measure the difference add a "sparse" enum type and a
benchmark for decoding it.

"Sparse" means the enum has large gaps between known enum values, or
negative enum values.

When decoding this kind of enums, the mapping from the wire `varint` to
the Dart value for the enum needs to be done by binary search, map
lookup, or similar.

For "dense" enums, we can have a list of enum values and index the list
directly with the `varint` value, after a range check.

These changes will be done in the follow-up PR(s).
2 files changed
tree: 6891a9cd4caa48eb86a5fdb40c28cb9307e75380
  1. .github/
  2. api_benchmark/
  3. benchmarks/
  4. protobuf/
  5. protoc_plugin/
  6. tool/
  7. .gitignore
  8. analysis_options.yaml
  9. AUTHORS
  10. LICENSE
  11. mono_repo.yaml
  12. README.md
README.md

Protobuf support for Dart

Protocol Buffers (protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.

This repository is home to packages related to protobuf support for Dart.

PackageDescriptionPublished Version
protobufRuntime library for protocol buffers support.pub package
protoc_pluginA protobuf protoc compiler plugin used to generate Dart code.[![pub package]
api_benchmarkBenchmarking a number of different api calls.
benchmarksBenchmarks for various protobuf functions.

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.