protobuf / benchmarks /

Filename Size Date modified Message
..
7.1 KB
228 B
82.6 KB
4.6 KB
4.6 KB
1.7 KB
Contents
--------

This folder contains three kinds of file:

- Code, such as ProtoBench.java, to build the benchmarking framework.
- Protocol buffer definitions (.proto files)
- Sample data files

If we end up with a lot of different benchmarks it may be worth
separating these out info different directories, but while there are
so few they might as well all be together.

Running a benchmark (Java)
--------------------------

1) Build protoc and the Java protocol buffer library. The examples
   below assume a jar file (protobuf.jar) has been built and copied
   into this directory.

2) Build ProtoBench:
   $ javac -d tmp -cp protobuf.jar ProtoBench.java
   
3) Generate code for the relevant benchmark protocol buffer, e.g.
   $ protoc --java_out=tmp google_size.proto google_speed.proto
   
4) Build the generated code, e.g.
   $ cd tmp
   $ javac -d . -cp ../protobuf.jar benchmarks/*.java
           
5) Run the test. Arguments are given in pairs - the first argument
   is the descriptor type; the second is the filename. For example:
   $ java -cp .;../protobuf.jar com.google.protocolbuffers.ProtoBench
          benchmarks.GoogleSize$SizeMessage1 ../google_message1.dat
          benchmarks.GoogleSpeed$SpeedMessage1 ../google_message1.dat
          benchmarks.GoogleSize$SizeMessage2 ../google_message2.dat
          benchmarks.GoogleSpeed$SpeedMessage2 ../google_message2.dat
          
6) Wait! Each test runs for around 30 seconds, and there are 6 tests
   per class/data combination. The above command would therefore take
   about 12 minutes to run.

   
Benchmarks available
--------------------

From Google:
google_size.proto and google_speed.proto, messages
google_message1.dat and google_message2.dat. The proto files are
equivalent, but optimized differently.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.