Add protobuf standard benchmarks #122
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Protobuf includes benchmarks for its official language implementations, such as Python, C++ and Golang. They measure average encode and decode throughput for each built-in dataset. This is useful to check how Elixir matches up with them.
https://github.com/protocolbuffers/protobuf/blob/master/benchmarks/README.md
For each dataset, it runs decode (then encode) on all the payloads. If that dry run takes longer than 3s, its time is taken as the average. Otherwise, repeat a few runs and average their times.
Caveat
Throughput is measured in MB/s, always based on the binary payload size from the dataset, even when the output size doesn't match – which is the case when the messages include proto2 groups, which are currently skipped. This can give unreliable results, so it's important to take that into account when comparing with feature-complete implementations.
Sample output