Index: third_party/protobuf/benchmarks/benchmarks.proto |
diff --git a/third_party/protobuf/java/src/test/java/com/google/protobuf/any_test.proto b/third_party/protobuf/benchmarks/benchmarks.proto |
similarity index 57% |
copy from third_party/protobuf/java/src/test/java/com/google/protobuf/any_test.proto |
copy to third_party/protobuf/benchmarks/benchmarks.proto |
index 80173d8a0e422f62c5a769a64c2e6896a8c12d78..51c0b548779effa77f838e9137bbce6b2accb107 100644 |
--- a/third_party/protobuf/java/src/test/java/com/google/protobuf/any_test.proto |
+++ b/third_party/protobuf/benchmarks/benchmarks.proto |
@@ -29,14 +29,35 @@ |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
syntax = "proto3"; |
+package benchmarks; |
+option java_package = "com.google.protobuf.benchmarks"; |
-package any_test; |
+message BenchmarkDataset { |
+ // Name of the benchmark dataset. This should be unique across all datasets. |
+ // Should only contain word characters: [a-zA-Z0-9_] |
+ string name = 1; |
-option java_package = "any_test"; |
-option java_outer_classname = "AnyTestProto"; |
+ // Fully-qualified name of the protobuf message for this dataset. |
+ // It will be one of the messages defined benchmark_messages_proto2.proto |
+ // or benchmark_messages_proto3.proto. |
+ // |
+ // Implementations that do not support reflection can implement this with |
+ // an explicit "if/else" chain that lists every known message defined |
+ // in those files. |
+ string message_name = 2; |
-import "google/protobuf/any.proto"; |
- |
-message TestAny { |
- google.protobuf.Any value = 1; |
+ // The payload(s) for this dataset. They should be parsed or serialized |
+ // in sequence, in a loop, ie. |
+ // |
+ // while (!benchmarkDone) { // Benchmark runner decides when to exit. |
+ // for (i = 0; i < benchmark.payload.length; i++) { |
+ // parse(benchmark.payload[i]) |
+ // } |
+ // } |
+ // |
+ // This is intended to let datasets include a variety of data to provide |
+ // potentially more realistic results than just parsing the same message |
+ // over and over. A single message parsed repeatedly could yield unusually |
+ // good branch prediction performance. |
+ repeated bytes payload = 3; |
} |