benchmarks.proto 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2008 Google Inc. All rights reserved.
  3. // https://developers.google.com/protocol-buffers/
  4. //
  5. // Redistribution and use in source and binary forms, with or without
  6. // modification, are permitted provided that the following conditions are
  7. // met:
  8. //
  9. // * Redistributions of source code must retain the above copyright
  10. // notice, this list of conditions and the following disclaimer.
  11. // * Redistributions in binary form must reproduce the above
  12. // copyright notice, this list of conditions and the following disclaimer
  13. // in the documentation and/or other materials provided with the
  14. // distribution.
  15. // * Neither the name of Google Inc. nor the names of its
  16. // contributors may be used to endorse or promote products derived from
  17. // this software without specific prior written permission.
  18. //
  19. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  23. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. syntax = "proto3";
  31. package benchmarks;
  32. option java_package = "com.google.protobuf.benchmarks";
  33. message BenchmarkDataset {
  34. // Name of the benchmark dataset. This should be unique across all datasets.
  35. // Should only contain word characters: [a-zA-Z0-9_]
  36. string name = 1;
  37. // Fully-qualified name of the protobuf message for this dataset.
  38. // It will be one of the messages defined benchmark_messages_proto2.proto
  39. // or benchmark_messages_proto3.proto.
  40. //
  41. // Implementations that do not support reflection can implement this with
  42. // an explicit "if/else" chain that lists every known message defined
  43. // in those files.
  44. string message_name = 2;
  45. // The payload(s) for this dataset. They should be parsed or serialized
  46. // in sequence, in a loop, ie.
  47. //
  48. // while (!benchmarkDone) { // Benchmark runner decides when to exit.
  49. // for (i = 0; i < benchmark.payload.length; i++) {
  50. // parse(benchmark.payload[i])
  51. // }
  52. // }
  53. //
  54. // This is intended to let datasets include a variety of data to provide
  55. // potentially more realistic results than just parsing the same message
  56. // over and over. A single message parsed repeatedly could yield unusually
  57. // good branch prediction performance.
  58. repeated bytes payload = 3;
  59. }
  60. // A benchmark can write out metrics that we will then upload to our metrics
  61. // database for tracking over time.
  62. message Metric {
  63. // A unique ID for these results. Used for de-duping.
  64. string guid = 1;
  65. // The tags specify exactly what benchmark was run against the dataset.
  66. // The specific benchmark suite can decide what these mean, but here are
  67. // some common tags that have a predefined meaning:
  68. //
  69. // - "dataset": for tests that pertain to a specific dataset.
  70. //
  71. // For example:
  72. //
  73. // # Tests parsing from binary proto string using arenas.
  74. // tags={
  75. // dataset: "testalltypes",
  76. // op: "parse",
  77. // format: "binaryproto",
  78. // input: "string"
  79. // arena: "true"
  80. // }
  81. //
  82. // # Tests serializing to JSON string.
  83. // tags={
  84. // dataset: "testalltypes",
  85. // op: "serialize",
  86. // format: "json",
  87. // input: "string"
  88. // }
  89. map<string, string> labels = 2;
  90. // Unit of measurement for the metric:
  91. // - a speed test might be "mb_per_second" or "ops_per_second"
  92. // - a size test might be "kb".
  93. string unit = 3;
  94. // Metric value.
  95. double value = 4;
  96. }