Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
Makefile.am | D | 03-May-2024 | 2.9 KiB | 70 | 46 | |
ProtoBench.java | D | 03-May-2024 | 8.1 KiB | 204 | 144 | |
README.md | D | 03-May-2024 | 923 | 29 | 21 | |
benchmark_messages_proto2.proto | D | 03-May-2024 | 4.7 KiB | 142 | 133 | |
benchmark_messages_proto3.proto | D | 03-May-2024 | 1.6 KiB | 77 | 71 | |
benchmarks.proto | D | 03-May-2024 | 2.9 KiB | 64 | 59 | |
generate_datasets.cc | D | 03-May-2024 | 4.4 KiB | 118 | 69 | |
google_message1.dat | D | 03-May-2024 | 228 | |||
google_message2.dat | D | 03-May-2024 | 82.6 KiB | |||
google_size.proto | D | 03-May-2024 | 4.6 KiB | 139 | 131 | |
readme.txt | D | 03-May-2024 | 1.7 KiB | 51 | 37 |
README.md
1 2# Protocol Buffers Benchmarks 3 4This directory contains benchmarking schemas and data sets that you 5can use to test a variety of performance scenarios against your 6protobuf language runtime. 7 8The schema for the datasets is described in `benchmarks.proto`. 9 10Generate the data sets like so: 11 12``` 13$ make 14$ ./generate-datasets 15Wrote dataset: dataset.google_message1_proto3.pb 16Wrote dataset: dataset.google_message1_proto2.pb 17Wrote dataset: dataset.google_message2.pb 18$ 19``` 20 21Each data set will be written to its own file. Benchmarks will 22likely want to run several benchmarks against each data set (parse, 23serialize, possibly JSON, possibly using different APIs, etc). 24 25We would like to add more data sets. In general we will favor data sets 26that make the overall suite diverse without being too large or having 27too many similar tests. Ideally everyone can run through the entire 28suite without the test run getting too long. 29
readme.txt
1Contents 2-------- 3 4This folder contains three kinds of file: 5 6- Code, such as ProtoBench.java, to build the benchmarking framework. 7- Protocol buffer definitions (.proto files) 8- Sample data files 9 10If we end up with a lot of different benchmarks it may be worth 11separating these out info different directories, but while there are 12so few they might as well all be together. 13 14Running a benchmark (Java) 15-------------------------- 16 171) Build protoc and the Java protocol buffer library. The examples 18 below assume a jar file (protobuf.jar) has been built and copied 19 into this directory. 20 212) Build ProtoBench: 22 $ javac -d tmp -cp protobuf.jar ProtoBench.java 23 243) Generate code for the relevant benchmark protocol buffer, e.g. 25 $ protoc --java_out=tmp google_size.proto google_speed.proto 26 274) Build the generated code, e.g. 28 $ cd tmp 29 $ javac -d . -cp ../protobuf.jar benchmarks/*.java 30 315) Run the test. Arguments are given in pairs - the first argument 32 is the descriptor type; the second is the filename. For example: 33 $ java -cp .;../protobuf.jar com.google.protocolbuffers.ProtoBench 34 benchmarks.GoogleSize$SizeMessage1 ../google_message1.dat 35 benchmarks.GoogleSpeed$SpeedMessage1 ../google_message1.dat 36 benchmarks.GoogleSize$SizeMessage2 ../google_message2.dat 37 benchmarks.GoogleSpeed$SpeedMessage2 ../google_message2.dat 38 396) Wait! Each test runs for around 30 seconds, and there are 6 tests 40 per class/data combination. The above command would therefore take 41 about 12 minutes to run. 42 43 44Benchmarks available 45-------------------- 46 47From Google: 48google_size.proto and google_speed.proto, messages 49google_message1.dat and google_message2.dat. The proto files are 50equivalent, but optimized differently. 51