@@ -144,6 +144,54 @@ Generated benchmarks/output/encode.html
144144Opened report using open
145145```
146146
147+ ## Protobuf standard benchmarks
148+
149+ Protobuf includes benchmarks for its official language implementations, such as Python, C++
150+ and Golang. They measure average encode and decode throughput for each built-in dataset. This
151+ is useful to check how Elixir matches up with them. You can read more about these benchmarks
152+ [ here] ( https://github.com/protocolbuffers/protobuf/blob/master/benchmarks/README.md ) .
153+
154+ To run the standard benchmarks for Elixir, download the datasets then run ` standard_bench.exs ` .
155+
156+ ``` console
157+ $ mix run script/standard_bench.exs
158+ Message benchmarks.proto2.GoogleMessage1 of dataset file data/dataset.google_message1_proto2.pb
159+ Average throughput for parse_from_benchmark: 18.48 MB/s
160+ Average throughput for serialize_to_benchmark: 6.19 MB/s
161+
162+ Message benchmarks.proto3.GoogleMessage1 of dataset file data/dataset.google_message1_proto3.pb
163+ Average throughput for parse_from_benchmark: 18.4 MB/s
164+ Average throughput for serialize_to_benchmark: 11.1 MB/s
165+
166+ Message benchmarks.proto2.GoogleMessage2 of dataset file data/dataset.google_message2.pb
167+ Average throughput for parse_from_benchmark: 47.82 MB/s
168+ Average throughput for serialize_to_benchmark: 5656.75 MB/s
169+
170+ Message benchmarks.google_message3.GoogleMessage3 of dataset file data/dataset.google_message3_1.pb
171+ Average throughput for parse_from_benchmark: 19.94 MB/s
172+ Average throughput for serialize_to_benchmark: 45.5 MB/s
173+
174+ Message benchmarks.google_message3.GoogleMessage3 of dataset file data/dataset.google_message3_2.pb
175+ Average throughput for parse_from_benchmark: 110.65 MB/s
176+ Average throughput for serialize_to_benchmark: 164.96 MB/s
177+
178+ Message benchmarks.google_message3.GoogleMessage3 of dataset file data/dataset.google_message3_3.pb
179+ Average throughput for parse_from_benchmark: 9.8 MB/s
180+ Average throughput for serialize_to_benchmark: 6.84 MB/s
181+
182+ Message benchmarks.google_message3.GoogleMessage3 of dataset file data/dataset.google_message3_4.pb
183+ Average throughput for parse_from_benchmark: 5254.14 MB/s
184+ Average throughput for serialize_to_benchmark: 737.71 MB/s
185+
186+ Message benchmarks.google_message3.GoogleMessage3 of dataset file data/dataset.google_message3_5.pb
187+ Average throughput for parse_from_benchmark: 3.77 MB/s
188+ Average throughput for serialize_to_benchmark: 3.29 MB/s
189+
190+ Message benchmarks.google_message4.GoogleMessage4 of dataset file data/dataset.google_message4.pb
191+ Average throughput for parse_from_benchmark: 20.06 MB/s
192+ Average throughput for serialize_to_benchmark: 32.46 MB/s
193+ ```
194+
147195## Contributing
148196
149197If you have trouble using the downloaded datasets, they might have been upgraded and their
0 commit comments