readme.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Contents
  2. --------
  3. This folder contains three kinds of file:
  4. - Code, such as ProtoBench.java, to build the benchmarking framework.
  5. - Protocol buffer definitions (.proto files)
  6. - Sample data files
  7. If we end up with a lot of different benchmarks it may be worth
  8. separating these out info different directories, but while there are
  9. so few they might as well all be together.
  10. Running a benchmark (Java)
  11. --------------------------
  12. 1) Build protoc and the Java protocol buffer library. The examples
  13. below assume a jar file (protobuf.jar) has been built and copied
  14. into this directory.
  15. 2) Build ProtoBench:
  16. $ javac -d tmp -cp protobuf.jar ProtoBench.java
  17. 3) Generate code for the relevant benchmark protocol buffer, e.g.
  18. $ protoc --java_out=tmp google_size.proto
  19. 4) Build the generated code, e.g.
  20. $ javac -d tmp -cp protobuf.jar tmp/benchmarks/*.java
  21. 5) Run the test. Arguments are given in pairs - the first argument
  22. is the descriptor type; the second is the filename. For example:
  23. $ java -cp tmp:protobuf.jar com.google.protocolbuffers.ProtoBench \
  24. 'benchmarks.GoogleSize$SizeMessage1' google_message1.dat \
  25. 'benchmarks.GoogleSize$SizeMessage2' google_message2.dat
  26. 6) Wait! Each test runs for around 30 seconds, and there are 8 tests
  27. per class/data combination. The above command would therefore take
  28. about 8 minutes to run.
  29. Benchmarks available
  30. --------------------
  31. From Google:
  32. google_size.proto,
  33. messages google_message1.dat and google_message2.dat.