protox 2.1.0
This release is mostly about performance. Compared with protox 2.0.10:
| Operation | CPU time | Reductions | Memory |
|---|---|---|---|
| Encode | - 9.2% | - 37.0% | - 40.6% |
| Decode | - 30.8% | - 59.3% | - 32.8% |
Compared with protobuf 0.17:
| Operation | CPU time | Reductions | Memory |
|---|---|---|---|
| Encode | - 60.0% | - 73.0% | - 29.1% |
| Decode | - 22.8% | - 56.4% | + 56.9% |
So, in these benchmarks, protox uses less CPU time and fewer reductions for both encoding and decoding, and less memory except when decoding. I’m still investigating this difference on memory allocation, but it seems it’s a tradeoff for faster decoding.
The benchmark suite uses a mix of synthetic messages based on the field distribution used by Google’s protobuf benchmarks, along with real-world schemas from OpenTelemetry and Prometheus.
As usual with benchmarks, your mileage may vary :-).
⚠️ One compatibility note: the generator version has changed in 2.1.0, so code generated with previous versions of protox needs to be regenerated.
Full changelog: https://protox.hexdocs.pm/changelog.html#2-1-0
