Benchmarks.cs 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: benchmarks.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace Benchmarks {
  12. /// <summary>Holder for reflection information generated from benchmarks.proto</summary>
  13. public static partial class BenchmarksReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for benchmarks.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static BenchmarksReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "ChBiZW5jaG1hcmtzLnByb3RvEgpiZW5jaG1hcmtzIkcKEEJlbmNobWFya0Rh",
  24. "dGFzZXQSDAoEbmFtZRgBIAEoCRIUCgxtZXNzYWdlX25hbWUYAiABKAkSDwoH",
  25. "cGF5bG9hZBgDIAMoDEIgCh5jb20uZ29vZ2xlLnByb3RvYnVmLmJlbmNobWFy",
  26. "a3NiBnByb3RvMw=="));
  27. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  28. new pbr::FileDescriptor[] { },
  29. new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
  30. new pbr::GeneratedClrTypeInfo(typeof(global::Benchmarks.BenchmarkDataset), global::Benchmarks.BenchmarkDataset.Parser, new[]{ "Name", "MessageName", "Payload" }, null, null, null)
  31. }));
  32. }
  33. #endregion
  34. }
  35. #region Messages
  36. public sealed partial class BenchmarkDataset : pb::IMessage<BenchmarkDataset> {
  37. private static readonly pb::MessageParser<BenchmarkDataset> _parser = new pb::MessageParser<BenchmarkDataset>(() => new BenchmarkDataset());
  38. private pb::UnknownFieldSet _unknownFields;
  39. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  40. public static pb::MessageParser<BenchmarkDataset> Parser { get { return _parser; } }
  41. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  42. public static pbr::MessageDescriptor Descriptor {
  43. get { return global::Benchmarks.BenchmarksReflection.Descriptor.MessageTypes[0]; }
  44. }
  45. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  46. pbr::MessageDescriptor pb::IMessage.Descriptor {
  47. get { return Descriptor; }
  48. }
  49. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  50. public BenchmarkDataset() {
  51. OnConstruction();
  52. }
  53. partial void OnConstruction();
  54. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  55. public BenchmarkDataset(BenchmarkDataset other) : this() {
  56. name_ = other.name_;
  57. messageName_ = other.messageName_;
  58. payload_ = other.payload_.Clone();
  59. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  60. }
  61. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  62. public BenchmarkDataset Clone() {
  63. return new BenchmarkDataset(this);
  64. }
  65. /// <summary>Field number for the "name" field.</summary>
  66. public const int NameFieldNumber = 1;
  67. private string name_ = "";
  68. /// <summary>
  69. /// Name of the benchmark dataset. This should be unique across all datasets.
  70. /// Should only contain word characters: [a-zA-Z0-9_]
  71. /// </summary>
  72. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  73. public string Name {
  74. get { return name_; }
  75. set {
  76. name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  77. }
  78. }
  79. /// <summary>Field number for the "message_name" field.</summary>
  80. public const int MessageNameFieldNumber = 2;
  81. private string messageName_ = "";
  82. /// <summary>
  83. /// Fully-qualified name of the protobuf message for this dataset.
  84. /// It will be one of the messages defined benchmark_messages_proto2.proto
  85. /// or benchmark_messages_proto3.proto.
  86. ///
  87. /// Implementations that do not support reflection can implement this with
  88. /// an explicit "if/else" chain that lists every known message defined
  89. /// in those files.
  90. /// </summary>
  91. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  92. public string MessageName {
  93. get { return messageName_; }
  94. set {
  95. messageName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  96. }
  97. }
  98. /// <summary>Field number for the "payload" field.</summary>
  99. public const int PayloadFieldNumber = 3;
  100. private static readonly pb::FieldCodec<pb::ByteString> _repeated_payload_codec
  101. = pb::FieldCodec.ForBytes(26);
  102. private readonly pbc::RepeatedField<pb::ByteString> payload_ = new pbc::RepeatedField<pb::ByteString>();
  103. /// <summary>
  104. /// The payload(s) for this dataset. They should be parsed or serialized
  105. /// in sequence, in a loop, ie.
  106. ///
  107. /// while (!benchmarkDone) { // Benchmark runner decides when to exit.
  108. /// for (i = 0; i &lt; benchmark.payload.length; i++) {
  109. /// parse(benchmark.payload[i])
  110. /// }
  111. /// }
  112. ///
  113. /// This is intended to let datasets include a variety of data to provide
  114. /// potentially more realistic results than just parsing the same message
  115. /// over and over. A single message parsed repeatedly could yield unusually
  116. /// good branch prediction performance.
  117. /// </summary>
  118. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  119. public pbc::RepeatedField<pb::ByteString> Payload {
  120. get { return payload_; }
  121. }
  122. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  123. public override bool Equals(object other) {
  124. return Equals(other as BenchmarkDataset);
  125. }
  126. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  127. public bool Equals(BenchmarkDataset other) {
  128. if (ReferenceEquals(other, null)) {
  129. return false;
  130. }
  131. if (ReferenceEquals(other, this)) {
  132. return true;
  133. }
  134. if (Name != other.Name) return false;
  135. if (MessageName != other.MessageName) return false;
  136. if(!payload_.Equals(other.payload_)) return false;
  137. return Equals(_unknownFields, other._unknownFields);
  138. }
  139. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  140. public override int GetHashCode() {
  141. int hash = 1;
  142. if (Name.Length != 0) hash ^= Name.GetHashCode();
  143. if (MessageName.Length != 0) hash ^= MessageName.GetHashCode();
  144. hash ^= payload_.GetHashCode();
  145. if (_unknownFields != null) {
  146. hash ^= _unknownFields.GetHashCode();
  147. }
  148. return hash;
  149. }
  150. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  151. public override string ToString() {
  152. return pb::JsonFormatter.ToDiagnosticString(this);
  153. }
  154. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  155. public void WriteTo(pb::CodedOutputStream output) {
  156. if (Name.Length != 0) {
  157. output.WriteRawTag(10);
  158. output.WriteString(Name);
  159. }
  160. if (MessageName.Length != 0) {
  161. output.WriteRawTag(18);
  162. output.WriteString(MessageName);
  163. }
  164. payload_.WriteTo(output, _repeated_payload_codec);
  165. if (_unknownFields != null) {
  166. _unknownFields.WriteTo(output);
  167. }
  168. }
  169. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  170. public int CalculateSize() {
  171. int size = 0;
  172. if (Name.Length != 0) {
  173. size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
  174. }
  175. if (MessageName.Length != 0) {
  176. size += 1 + pb::CodedOutputStream.ComputeStringSize(MessageName);
  177. }
  178. size += payload_.CalculateSize(_repeated_payload_codec);
  179. if (_unknownFields != null) {
  180. size += _unknownFields.CalculateSize();
  181. }
  182. return size;
  183. }
  184. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  185. public void MergeFrom(BenchmarkDataset other) {
  186. if (other == null) {
  187. return;
  188. }
  189. if (other.Name.Length != 0) {
  190. Name = other.Name;
  191. }
  192. if (other.MessageName.Length != 0) {
  193. MessageName = other.MessageName;
  194. }
  195. payload_.Add(other.payload_);
  196. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  197. }
  198. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  199. public void MergeFrom(pb::CodedInputStream input) {
  200. uint tag;
  201. while ((tag = input.ReadTag()) != 0) {
  202. switch(tag) {
  203. default:
  204. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  205. break;
  206. case 10: {
  207. Name = input.ReadString();
  208. break;
  209. }
  210. case 18: {
  211. MessageName = input.ReadString();
  212. break;
  213. }
  214. case 26: {
  215. payload_.AddEntriesFrom(input, _repeated_payload_codec);
  216. break;
  217. }
  218. }
  219. }
  220. }
  221. }
  222. #endregion
  223. }
  224. #endregion Designer generated code