readme.txt 1.5 KB
Newer Older
jonathan.skeet's avatar
jonathan.skeet committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
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.
25
   $ protoc --java_out=tmp google_size.proto
jonathan.skeet's avatar
jonathan.skeet committed
26 27
   
4) Build the generated code, e.g.
28
   $ javac -d tmp -cp protobuf.jar tmp/benchmarks/*.java
jonathan.skeet's avatar
jonathan.skeet committed
29 30 31
           
5) Run the test. Arguments are given in pairs - the first argument
   is the descriptor type; the second is the filename. For example:
32 33 34
   $ java -cp tmp:protobuf.jar com.google.protocolbuffers.ProtoBench \
       'benchmarks.GoogleSize$SizeMessage1' google_message1.dat \
       'benchmarks.GoogleSize$SizeMessage2' google_message2.dat
jonathan.skeet's avatar
jonathan.skeet committed
35
          
36
6) Wait! Each test runs for around 30 seconds, and there are 8 tests
jonathan.skeet's avatar
jonathan.skeet committed
37
   per class/data combination. The above command would therefore take
38
   about 8 minutes to run.
jonathan.skeet's avatar
jonathan.skeet committed
39 40 41 42 43 44

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

From Google:
45 46
google_size.proto,
messages google_message1.dat and google_message2.dat.