Commit 79c72a99 authored by Jon Skeet's avatar Jon Skeet Committed by unknown

Benchmarking

parent 343d9f54
......@@ -15,6 +15,7 @@
<property name="src"
value="${project::get-base-directory()}/src" />
<property name="tools-protoc"
value="${project::get-base-directory()}/lib/protoc.exe"
......@@ -25,6 +26,11 @@
value="${path::combine(project::get-base-directory(), 'dist')}"
overwrite="false" />
<!-- Directory to find test data -->
<property name="testdata-dir"
value="${path::combine(project::get-base-directory(), 'testdata')}"
overwrite="false" />
<!-- Base directory to find protos (core, C# options, tests) -->
<property name="protos-dir"
value="${path::combine(project::get-base-directory(), 'protos')}"
......@@ -37,13 +43,16 @@
<!-- Which version of protogen to use when regenerating source -->
<property name="tools-protogen-config"
value="Debug"
value="${build-configuration}"
overwrite="false" />
<property name="tools-protogen"
value="${src}/ProtoGen/bin/${tools-protogen-config}/protogen.exe"
overwrite="false"/>
<property name="tools-protobench" value="${src}/ProtoBench/bin/${build-configuration}/protobench.exe"
overwrite="false"/>
<target name="clean-build"
description="Rebuilds all source and binaries, including distribution">
......@@ -96,6 +105,7 @@
<arg value="--proto_path=${protos-dir}" />
<arg value="--descriptor_set_out=compiled.pb" />
<arg file="${protos-dir}/google/protobuf/benchmark.proto" />
<arg file="${protos-dir}/google/protobuf/benchmark_speed.proto" />
<arg file="${protos-dir}/google/protobuf/descriptor.proto" />
<arg file="${protos-dir}/google/protobuf/csharp_options.proto" />
<arg file="${protos-dir}/google/protobuf/unittest.proto" />
......@@ -142,10 +152,11 @@
<copy todir="${src}/ProtoBench">
<fileset basedir="${tmp-dir}">
<include name="BenchmarkProtoFile.cs" />
<include name="BenchmarkSpeedProtoFile.cs" />
</fileset>
</copy>
</target>
<target name="build"
description="Builds all C# code">
<msbuild project="${src}/ProtocolBuffers.sln">
......@@ -165,7 +176,17 @@
<target name="perf-test"
description="Runs all performance tests">
<fail message="Performance tests not implemented yet" />
<exec program="${tools-protobench}"
workingdir="${testdata-dir}">
<arg value="Google.ProtocolBuffers.BenchmarkProtos.Message1,ProtoBench" />
<arg value="benchmark_message1.dat" />
<arg value="Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage1,ProtoBench" />
<arg value="benchmark_message1.dat" />
<arg value="Google.ProtocolBuffers.BenchmarkProtos.Message3,ProtoBench" />
<arg value="benchmark_message3.dat" />
<arg value="Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3,ProtoBench" />
<arg value="benchmark_message3.dat" />
</exec>
</target>
<target name="dist"
......
......@@ -4,8 +4,6 @@ option (google.protobuf.csharp_file_options).umbrella_classname = "BenchmarkProt
package proto2.benchmark.v2_api;
option optimize_for = SPEED;
message Message1 {
required string field1 = 1;
optional string field9 = 9;
......
import "google/protobuf/csharp_options.proto";
option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.BenchmarkProtos";
option (google.protobuf.csharp_file_options).umbrella_classname = "BenchmarkSpeedProtoFile";
package proto2.benchmark.v2_api;
option optimize_for = SPEED;
message SpeedMessage1 {
required string field1 = 1;
optional string field9 = 9;
optional string field18 = 18;
optional bool field80 = 80 [default=false];
optional bool field81 = 81 [default=true];
required int32 field2 = 2;
required int32 field3 = 3;
optional int32 field280 = 280;
optional int32 field6 = 6 [default=0];
optional int64 field22 = 22;
optional string field4 = 4;
repeated fixed64 field5 = 5;
optional bool field59 = 59 [default=false];
optional string field7 = 7;
optional int32 field16 = 16;
optional int32 field130 = 130 [default=0];
optional bool field12 = 12 [default=true];
optional bool field17 = 17 [default=true];
optional bool field13 = 13 [default=true];
optional bool field14 = 14 [default=true];
optional int32 field104 = 104 [default=0];
optional int32 field100 = 100 [default=0];
optional int32 field101 = 101 [default=0];
optional string field102 = 102;
optional string field103 = 103;
optional int32 field29 = 29 [default=0];
optional bool field30 = 30 [default=false];
optional int32 field60 = 60 [default=-1];
optional int32 field271 = 271 [default=-1];
optional int32 field272 = 272 [default=-1];
optional int32 field150 = 150;
optional int32 field23 = 23 [default=0];
optional bool field24 = 24 [default=false];
optional int32 field25 = 25 [default=0];
optional SpeedMessage2 field15 = 15;
optional bool field78 = 78;
optional int32 field67 = 67 [default=0];
optional int32 field68 = 68;
optional int32 field128 = 128 [default=0];
optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"];
optional int32 field131 = 131 [default=0];
}
message SpeedMessage2 {
optional int32 field1 = 1 [default=0];
optional int32 field2 = 2 [default=0];
optional int32 field3 = 3 [default=0];
optional string field15 = 15;
optional bool field12 = 12 [default=true];
optional int64 field13 = 13;
optional int64 field14 = 14;
optional int32 field16 = 16;
optional int32 field19 = 19 [default=2];
optional bool field20 = 20 [default=true];
optional bool field28 = 28 [default=true];
optional fixed64 field21 = 21;
optional int32 field22 = 22;
optional bool field23 = 23 [ default=false ];
optional bool field206 = 206 [default=false];
optional fixed32 field203 = 203;
optional int32 field204 = 204;
optional string field205 = 205;
optional uint64 field207 = 207;
optional uint64 field300 = 300;
}
message SpeedMessage3 {
optional string field1 = 1;
optional int64 field3 = 3;
optional int64 field4 = 4;
optional int64 field30 = 30;
optional bool field75 = 75 [default=false];
optional string field6 = 6;
optional bytes field2 = 2;
optional int32 field21 = 21 [default=0];
optional int32 field71 = 71;
optional float field25 = 25;
optional int32 field109 = 109 [default=0];
optional int32 field210 = 210 [default=0];
optional int32 field211 = 211 [default=0];
optional int32 field212 = 212 [default=0];
optional int32 field213 = 213 [default=0];
optional int32 field216 = 216 [default=0];
optional int32 field217 = 217 [default=0];
optional int32 field218 = 218 [default=0];
optional int32 field220 = 220 [default=0];
optional int32 field221 = 221 [default=0];
optional float field222 = 222 [default=0.0];
optional int32 field63 = 63;
repeated group Group1 = 10 {
required float field11 = 11;
optional float field26 = 26;
optional string field12 = 12;
optional string field13 = 13;
repeated string field14 = 14;
required uint64 field15 = 15;
optional int32 field5 = 5;
optional string field27 = 27;
optional int32 field28 = 28;
optional string field29 = 29;
optional string field16 = 16;
repeated string field22 = 22;
repeated int32 field73 = 73;
optional int32 field20 = 20 [default=0];
optional string field24 = 24;
optional SpeedMessage4 field31 = 31;
}
repeated string field128 = 128;
optional int64 field131 = 131;
repeated string field127 = 127;
optional int32 field129 = 129;
repeated int64 field130 = 130;
optional bool field205 = 205 [default=false];
optional bool field206 = 206 [default=false];
}
message SpeedMessage4 {
optional float field1 = 1;
optional float field2 = 2;
optional float field3 = 3 [default=0.0];
optional bool field4 = 4;
optional bool field5 = 5;
optional bool field6 = 6 [default=true];
optional bool field7 = 7 [default=false];
optional float field8 = 8;
optional bool field9 = 9;
optional float field10 = 10;
optional int64 field11 = 11;
}
......@@ -70,9 +70,9 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
"Eg4KBmZpZWxkMhgCIAEoAhIRCgZmaWVsZDMYAyABKAI6ATASDgoGZmllbGQ0" +
"GAQgASgIEg4KBmZpZWxkNRgFIAEoCBIUCgZmaWVsZDYYBiABKAg6BHRydWUS" +
"FQoGZmllbGQ3GAcgASgIOgVmYWxzZRIOCgZmaWVsZDgYCCABKAISDgoGZmll" +
"bGQ5GAkgASgIEg8KB2ZpZWxkMTAYCiABKAISDwoHZmllbGQxMRgLIAEoA0JB" +
"SAHCPjwKJkdvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuQmVuY2htYXJrUHJvdG9z" +
"EhJCZW5jaG1hcmtQcm90b0ZpbGU="),
"bGQ5GAkgASgIEg8KB2ZpZWxkMTAYCiABKAISDwoHZmllbGQxMRgLIAEoA0I/" +
"wj48CiZHb29nbGUuUHJvdG9jb2xCdWZmZXJzLkJlbmNobWFya1Byb3RvcxIS" +
"QmVuY2htYXJrUHJvdG9GaWxl"),
new pbd::FileDescriptor[] {
global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor,
});
......@@ -500,278 +500,6 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
get { return field131_; }
}
public override bool IsInitialized {
get {
if (!hasField1) return false;
if (!hasField2) return false;
if (!hasField3) return false;
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
if (HasField1) {
output.WriteString(1, Field1);
}
if (HasField2) {
output.WriteInt32(2, Field2);
}
if (HasField3) {
output.WriteInt32(3, Field3);
}
if (HasField4) {
output.WriteString(4, Field4);
}
foreach (ulong element in Field5List) {
output.WriteFixed64(5, element);
}
if (HasField6) {
output.WriteInt32(6, Field6);
}
if (HasField7) {
output.WriteString(7, Field7);
}
if (HasField9) {
output.WriteString(9, Field9);
}
if (HasField12) {
output.WriteBool(12, Field12);
}
if (HasField13) {
output.WriteBool(13, Field13);
}
if (HasField14) {
output.WriteBool(14, Field14);
}
if (HasField15) {
output.WriteMessage(15, Field15);
}
if (HasField16) {
output.WriteInt32(16, Field16);
}
if (HasField17) {
output.WriteBool(17, Field17);
}
if (HasField18) {
output.WriteString(18, Field18);
}
if (HasField22) {
output.WriteInt64(22, Field22);
}
if (HasField23) {
output.WriteInt32(23, Field23);
}
if (HasField24) {
output.WriteBool(24, Field24);
}
if (HasField25) {
output.WriteInt32(25, Field25);
}
if (HasField29) {
output.WriteInt32(29, Field29);
}
if (HasField30) {
output.WriteBool(30, Field30);
}
if (HasField59) {
output.WriteBool(59, Field59);
}
if (HasField60) {
output.WriteInt32(60, Field60);
}
if (HasField67) {
output.WriteInt32(67, Field67);
}
if (HasField68) {
output.WriteInt32(68, Field68);
}
if (HasField78) {
output.WriteBool(78, Field78);
}
if (HasField80) {
output.WriteBool(80, Field80);
}
if (HasField81) {
output.WriteBool(81, Field81);
}
if (HasField100) {
output.WriteInt32(100, Field100);
}
if (HasField101) {
output.WriteInt32(101, Field101);
}
if (HasField102) {
output.WriteString(102, Field102);
}
if (HasField103) {
output.WriteString(103, Field103);
}
if (HasField104) {
output.WriteInt32(104, Field104);
}
if (HasField128) {
output.WriteInt32(128, Field128);
}
if (HasField129) {
output.WriteString(129, Field129);
}
if (HasField130) {
output.WriteInt32(130, Field130);
}
if (HasField131) {
output.WriteInt32(131, Field131);
}
if (HasField150) {
output.WriteInt32(150, Field150);
}
if (HasField271) {
output.WriteInt32(271, Field271);
}
if (HasField272) {
output.WriteInt32(272, Field272);
}
if (HasField280) {
output.WriteInt32(280, Field280);
}
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (HasField1) {
size += pb::CodedOutputStream.ComputeStringSize(1, Field1);
}
if (HasField9) {
size += pb::CodedOutputStream.ComputeStringSize(9, Field9);
}
if (HasField18) {
size += pb::CodedOutputStream.ComputeStringSize(18, Field18);
}
if (HasField80) {
size += pb::CodedOutputStream.ComputeBoolSize(80, Field80);
}
if (HasField81) {
size += pb::CodedOutputStream.ComputeBoolSize(81, Field81);
}
if (HasField2) {
size += pb::CodedOutputStream.ComputeInt32Size(2, Field2);
}
if (HasField3) {
size += pb::CodedOutputStream.ComputeInt32Size(3, Field3);
}
if (HasField280) {
size += pb::CodedOutputStream.ComputeInt32Size(280, Field280);
}
if (HasField6) {
size += pb::CodedOutputStream.ComputeInt32Size(6, Field6);
}
if (HasField22) {
size += pb::CodedOutputStream.ComputeInt64Size(22, Field22);
}
if (HasField4) {
size += pb::CodedOutputStream.ComputeStringSize(4, Field4);
}
foreach (ulong element in Field5List) {
size += pb::CodedOutputStream.ComputeFixed64Size(5, element);
}
if (HasField59) {
size += pb::CodedOutputStream.ComputeBoolSize(59, Field59);
}
if (HasField7) {
size += pb::CodedOutputStream.ComputeStringSize(7, Field7);
}
if (HasField16) {
size += pb::CodedOutputStream.ComputeInt32Size(16, Field16);
}
if (HasField130) {
size += pb::CodedOutputStream.ComputeInt32Size(130, Field130);
}
if (HasField12) {
size += pb::CodedOutputStream.ComputeBoolSize(12, Field12);
}
if (HasField17) {
size += pb::CodedOutputStream.ComputeBoolSize(17, Field17);
}
if (HasField13) {
size += pb::CodedOutputStream.ComputeBoolSize(13, Field13);
}
if (HasField14) {
size += pb::CodedOutputStream.ComputeBoolSize(14, Field14);
}
if (HasField104) {
size += pb::CodedOutputStream.ComputeInt32Size(104, Field104);
}
if (HasField100) {
size += pb::CodedOutputStream.ComputeInt32Size(100, Field100);
}
if (HasField101) {
size += pb::CodedOutputStream.ComputeInt32Size(101, Field101);
}
if (HasField102) {
size += pb::CodedOutputStream.ComputeStringSize(102, Field102);
}
if (HasField103) {
size += pb::CodedOutputStream.ComputeStringSize(103, Field103);
}
if (HasField29) {
size += pb::CodedOutputStream.ComputeInt32Size(29, Field29);
}
if (HasField30) {
size += pb::CodedOutputStream.ComputeBoolSize(30, Field30);
}
if (HasField60) {
size += pb::CodedOutputStream.ComputeInt32Size(60, Field60);
}
if (HasField271) {
size += pb::CodedOutputStream.ComputeInt32Size(271, Field271);
}
if (HasField272) {
size += pb::CodedOutputStream.ComputeInt32Size(272, Field272);
}
if (HasField150) {
size += pb::CodedOutputStream.ComputeInt32Size(150, Field150);
}
if (HasField23) {
size += pb::CodedOutputStream.ComputeInt32Size(23, Field23);
}
if (HasField24) {
size += pb::CodedOutputStream.ComputeBoolSize(24, Field24);
}
if (HasField25) {
size += pb::CodedOutputStream.ComputeInt32Size(25, Field25);
}
if (HasField15) {
size += pb::CodedOutputStream.ComputeMessageSize(15, Field15);
}
if (HasField78) {
size += pb::CodedOutputStream.ComputeBoolSize(78, Field78);
}
if (HasField67) {
size += pb::CodedOutputStream.ComputeInt32Size(67, Field67);
}
if (HasField68) {
size += pb::CodedOutputStream.ComputeInt32Size(68, Field68);
}
if (HasField128) {
size += pb::CodedOutputStream.ComputeInt32Size(128, Field128);
}
if (HasField129) {
size += pb::CodedOutputStream.ComputeStringSize(129, Field129);
}
if (HasField131) {
size += pb::CodedOutputStream.ComputeInt32Size(131, Field131);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
}
public static Message1 ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -838,337 +566,6 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
return returnMe;
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is Message1) {
return MergeFrom((Message1) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(Message1 other) {
if (other == Message1.DefaultInstance) return this;
if (other.HasField1) {
Field1 = other.Field1;
}
if (other.HasField9) {
Field9 = other.Field9;
}
if (other.HasField18) {
Field18 = other.Field18;
}
if (other.HasField80) {
Field80 = other.Field80;
}
if (other.HasField81) {
Field81 = other.Field81;
}
if (other.HasField2) {
Field2 = other.Field2;
}
if (other.HasField3) {
Field3 = other.Field3;
}
if (other.HasField280) {
Field280 = other.Field280;
}
if (other.HasField6) {
Field6 = other.Field6;
}
if (other.HasField22) {
Field22 = other.Field22;
}
if (other.HasField4) {
Field4 = other.Field4;
}
if (other.field5_.Count != 0) {
base.AddRange(other.field5_, result.field5_);
}
if (other.HasField59) {
Field59 = other.Field59;
}
if (other.HasField7) {
Field7 = other.Field7;
}
if (other.HasField16) {
Field16 = other.Field16;
}
if (other.HasField130) {
Field130 = other.Field130;
}
if (other.HasField12) {
Field12 = other.Field12;
}
if (other.HasField17) {
Field17 = other.Field17;
}
if (other.HasField13) {
Field13 = other.Field13;
}
if (other.HasField14) {
Field14 = other.Field14;
}
if (other.HasField104) {
Field104 = other.Field104;
}
if (other.HasField100) {
Field100 = other.Field100;
}
if (other.HasField101) {
Field101 = other.Field101;
}
if (other.HasField102) {
Field102 = other.Field102;
}
if (other.HasField103) {
Field103 = other.Field103;
}
if (other.HasField29) {
Field29 = other.Field29;
}
if (other.HasField30) {
Field30 = other.Field30;
}
if (other.HasField60) {
Field60 = other.Field60;
}
if (other.HasField271) {
Field271 = other.Field271;
}
if (other.HasField272) {
Field272 = other.Field272;
}
if (other.HasField150) {
Field150 = other.Field150;
}
if (other.HasField23) {
Field23 = other.Field23;
}
if (other.HasField24) {
Field24 = other.Field24;
}
if (other.HasField25) {
Field25 = other.Field25;
}
if (other.HasField15) {
MergeField15(other.Field15);
}
if (other.HasField78) {
Field78 = other.Field78;
}
if (other.HasField67) {
Field67 = other.Field67;
}
if (other.HasField68) {
Field68 = other.Field68;
}
if (other.HasField128) {
Field128 = other.Field128;
}
if (other.HasField129) {
Field129 = other.Field129;
}
if (other.HasField131) {
Field131 = other.Field131;
}
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override Builder MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0: {
this.UnknownFields = unknownFields.Build();
return this;
}
default: {
if (!ParseUnknownField(input, unknownFields, extensionRegistry, tag)) {
this.UnknownFields = unknownFields.Build();
return this;
}
break;
}
case 10: {
Field1 = input.ReadString();
break;
}
case 16: {
Field2 = input.ReadInt32();
break;
}
case 24: {
Field3 = input.ReadInt32();
break;
}
case 34: {
Field4 = input.ReadString();
break;
}
case 41: {
AddField5(input.ReadFixed64());
break;
}
case 48: {
Field6 = input.ReadInt32();
break;
}
case 58: {
Field7 = input.ReadString();
break;
}
case 74: {
Field9 = input.ReadString();
break;
}
case 96: {
Field12 = input.ReadBool();
break;
}
case 104: {
Field13 = input.ReadBool();
break;
}
case 112: {
Field14 = input.ReadBool();
break;
}
case 122: {
global::Google.ProtocolBuffers.BenchmarkProtos.Message2.Builder subBuilder = global::Google.ProtocolBuffers.BenchmarkProtos.Message2.CreateBuilder();
if (HasField15) {
subBuilder.MergeFrom(Field15);
}
input.ReadMessage(subBuilder, extensionRegistry);
Field15 = subBuilder.BuildPartial();
break;
}
case 128: {
Field16 = input.ReadInt32();
break;
}
case 136: {
Field17 = input.ReadBool();
break;
}
case 146: {
Field18 = input.ReadString();
break;
}
case 176: {
Field22 = input.ReadInt64();
break;
}
case 184: {
Field23 = input.ReadInt32();
break;
}
case 192: {
Field24 = input.ReadBool();
break;
}
case 200: {
Field25 = input.ReadInt32();
break;
}
case 232: {
Field29 = input.ReadInt32();
break;
}
case 240: {
Field30 = input.ReadBool();
break;
}
case 472: {
Field59 = input.ReadBool();
break;
}
case 480: {
Field60 = input.ReadInt32();
break;
}
case 536: {
Field67 = input.ReadInt32();
break;
}
case 544: {
Field68 = input.ReadInt32();
break;
}
case 624: {
Field78 = input.ReadBool();
break;
}
case 640: {
Field80 = input.ReadBool();
break;
}
case 648: {
Field81 = input.ReadBool();
break;
}
case 800: {
Field100 = input.ReadInt32();
break;
}
case 808: {
Field101 = input.ReadInt32();
break;
}
case 818: {
Field102 = input.ReadString();
break;
}
case 826: {
Field103 = input.ReadString();
break;
}
case 832: {
Field104 = input.ReadInt32();
break;
}
case 1024: {
Field128 = input.ReadInt32();
break;
}
case 1034: {
Field129 = input.ReadString();
break;
}
case 1040: {
Field130 = input.ReadInt32();
break;
}
case 1048: {
Field131 = input.ReadInt32();
break;
}
case 1200: {
Field150 = input.ReadInt32();
break;
}
case 2168: {
Field271 = input.ReadInt32();
break;
}
case 2176: {
Field272 = input.ReadInt32();
break;
}
case 2240: {
Field280 = input.ReadInt32();
break;
}
}
}
}
public bool HasField1 {
get { return result.HasField1; }
......@@ -2135,149 +1532,6 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
get { return field300_; }
}
public override bool IsInitialized {
get {
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
if (HasField1) {
output.WriteInt32(1, Field1);
}
if (HasField2) {
output.WriteInt32(2, Field2);
}
if (HasField3) {
output.WriteInt32(3, Field3);
}
if (HasField12) {
output.WriteBool(12, Field12);
}
if (HasField13) {
output.WriteInt64(13, Field13);
}
if (HasField14) {
output.WriteInt64(14, Field14);
}
if (HasField15) {
output.WriteString(15, Field15);
}
if (HasField16) {
output.WriteInt32(16, Field16);
}
if (HasField19) {
output.WriteInt32(19, Field19);
}
if (HasField20) {
output.WriteBool(20, Field20);
}
if (HasField21) {
output.WriteFixed64(21, Field21);
}
if (HasField22) {
output.WriteInt32(22, Field22);
}
if (HasField23) {
output.WriteBool(23, Field23);
}
if (HasField28) {
output.WriteBool(28, Field28);
}
if (HasField203) {
output.WriteFixed32(203, Field203);
}
if (HasField204) {
output.WriteInt32(204, Field204);
}
if (HasField205) {
output.WriteString(205, Field205);
}
if (HasField206) {
output.WriteBool(206, Field206);
}
if (HasField207) {
output.WriteUInt64(207, Field207);
}
if (HasField300) {
output.WriteUInt64(300, Field300);
}
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (HasField1) {
size += pb::CodedOutputStream.ComputeInt32Size(1, Field1);
}
if (HasField2) {
size += pb::CodedOutputStream.ComputeInt32Size(2, Field2);
}
if (HasField3) {
size += pb::CodedOutputStream.ComputeInt32Size(3, Field3);
}
if (HasField15) {
size += pb::CodedOutputStream.ComputeStringSize(15, Field15);
}
if (HasField12) {
size += pb::CodedOutputStream.ComputeBoolSize(12, Field12);
}
if (HasField13) {
size += pb::CodedOutputStream.ComputeInt64Size(13, Field13);
}
if (HasField14) {
size += pb::CodedOutputStream.ComputeInt64Size(14, Field14);
}
if (HasField16) {
size += pb::CodedOutputStream.ComputeInt32Size(16, Field16);
}
if (HasField19) {
size += pb::CodedOutputStream.ComputeInt32Size(19, Field19);
}
if (HasField20) {
size += pb::CodedOutputStream.ComputeBoolSize(20, Field20);
}
if (HasField28) {
size += pb::CodedOutputStream.ComputeBoolSize(28, Field28);
}
if (HasField21) {
size += pb::CodedOutputStream.ComputeFixed64Size(21, Field21);
}
if (HasField22) {
size += pb::CodedOutputStream.ComputeInt32Size(22, Field22);
}
if (HasField23) {
size += pb::CodedOutputStream.ComputeBoolSize(23, Field23);
}
if (HasField206) {
size += pb::CodedOutputStream.ComputeBoolSize(206, Field206);
}
if (HasField203) {
size += pb::CodedOutputStream.ComputeFixed32Size(203, Field203);
}
if (HasField204) {
size += pb::CodedOutputStream.ComputeInt32Size(204, Field204);
}
if (HasField205) {
size += pb::CodedOutputStream.ComputeStringSize(205, Field205);
}
if (HasField207) {
size += pb::CodedOutputStream.ComputeUInt64Size(207, Field207);
}
if (HasField300) {
size += pb::CodedOutputStream.ComputeUInt64Size(300, Field300);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
}
public static Message2 ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -2343,185 +1597,6 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
return returnMe;
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is Message2) {
return MergeFrom((Message2) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(Message2 other) {
if (other == Message2.DefaultInstance) return this;
if (other.HasField1) {
Field1 = other.Field1;
}
if (other.HasField2) {
Field2 = other.Field2;
}
if (other.HasField3) {
Field3 = other.Field3;
}
if (other.HasField15) {
Field15 = other.Field15;
}
if (other.HasField12) {
Field12 = other.Field12;
}
if (other.HasField13) {
Field13 = other.Field13;
}
if (other.HasField14) {
Field14 = other.Field14;
}
if (other.HasField16) {
Field16 = other.Field16;
}
if (other.HasField19) {
Field19 = other.Field19;
}
if (other.HasField20) {
Field20 = other.Field20;
}
if (other.HasField28) {
Field28 = other.Field28;
}
if (other.HasField21) {
Field21 = other.Field21;
}
if (other.HasField22) {
Field22 = other.Field22;
}
if (other.HasField23) {
Field23 = other.Field23;
}
if (other.HasField206) {
Field206 = other.Field206;
}
if (other.HasField203) {
Field203 = other.Field203;
}
if (other.HasField204) {
Field204 = other.Field204;
}
if (other.HasField205) {
Field205 = other.Field205;
}
if (other.HasField207) {
Field207 = other.Field207;
}
if (other.HasField300) {
Field300 = other.Field300;
}
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override Builder MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0: {
this.UnknownFields = unknownFields.Build();
return this;
}
default: {
if (!ParseUnknownField(input, unknownFields, extensionRegistry, tag)) {
this.UnknownFields = unknownFields.Build();
return this;
}
break;
}
case 8: {
Field1 = input.ReadInt32();
break;
}
case 16: {
Field2 = input.ReadInt32();
break;
}
case 24: {
Field3 = input.ReadInt32();
break;
}
case 96: {
Field12 = input.ReadBool();
break;
}
case 104: {
Field13 = input.ReadInt64();
break;
}
case 112: {
Field14 = input.ReadInt64();
break;
}
case 122: {
Field15 = input.ReadString();
break;
}
case 128: {
Field16 = input.ReadInt32();
break;
}
case 152: {
Field19 = input.ReadInt32();
break;
}
case 160: {
Field20 = input.ReadBool();
break;
}
case 169: {
Field21 = input.ReadFixed64();
break;
}
case 176: {
Field22 = input.ReadInt32();
break;
}
case 184: {
Field23 = input.ReadBool();
break;
}
case 224: {
Field28 = input.ReadBool();
break;
}
case 1629: {
Field203 = input.ReadFixed32();
break;
}
case 1632: {
Field204 = input.ReadInt32();
break;
}
case 1642: {
Field205 = input.ReadString();
break;
}
case 1648: {
Field206 = input.ReadBool();
break;
}
case 1656: {
Field207 = input.ReadUInt64();
break;
}
case 2400: {
Field300 = input.ReadUInt64();
break;
}
}
}
}
public bool HasField1 {
get { return result.HasField1; }
......@@ -3063,143 +2138,22 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
get { return field20_; }
}
private bool hasField24;
private string field24_ = "";
public bool HasField24 {
get { return hasField24; }
}
public string Field24 {
get { return field24_; }
}
private bool hasField31;
private global::Google.ProtocolBuffers.BenchmarkProtos.Message4 field31_ = global::Google.ProtocolBuffers.BenchmarkProtos.Message4.DefaultInstance;
public bool HasField31 {
get { return hasField31; }
}
public global::Google.ProtocolBuffers.BenchmarkProtos.Message4 Field31 {
get { return field31_; }
}
public override bool IsInitialized {
get {
if (!hasField11) return false;
if (!hasField15) return false;
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
if (HasField5) {
output.WriteInt32(5, Field5);
}
if (HasField11) {
output.WriteFloat(11, Field11);
}
if (HasField12) {
output.WriteString(12, Field12);
}
if (HasField13) {
output.WriteString(13, Field13);
}
foreach (string element in Field14List) {
output.WriteString(14, element);
}
if (HasField15) {
output.WriteUInt64(15, Field15);
}
if (HasField16) {
output.WriteString(16, Field16);
}
if (HasField20) {
output.WriteInt32(20, Field20);
}
foreach (string element in Field22List) {
output.WriteString(22, element);
}
if (HasField24) {
output.WriteString(24, Field24);
}
if (HasField26) {
output.WriteFloat(26, Field26);
}
if (HasField27) {
output.WriteString(27, Field27);
}
if (HasField28) {
output.WriteInt32(28, Field28);
}
if (HasField29) {
output.WriteString(29, Field29);
}
if (HasField31) {
output.WriteMessage(31, Field31);
}
foreach (int element in Field73List) {
output.WriteInt32(73, element);
}
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (HasField11) {
size += pb::CodedOutputStream.ComputeFloatSize(11, Field11);
}
if (HasField26) {
size += pb::CodedOutputStream.ComputeFloatSize(26, Field26);
}
if (HasField12) {
size += pb::CodedOutputStream.ComputeStringSize(12, Field12);
}
if (HasField13) {
size += pb::CodedOutputStream.ComputeStringSize(13, Field13);
}
foreach (string element in Field14List) {
size += pb::CodedOutputStream.ComputeStringSize(14, element);
}
if (HasField15) {
size += pb::CodedOutputStream.ComputeUInt64Size(15, Field15);
}
if (HasField5) {
size += pb::CodedOutputStream.ComputeInt32Size(5, Field5);
}
if (HasField27) {
size += pb::CodedOutputStream.ComputeStringSize(27, Field27);
}
if (HasField28) {
size += pb::CodedOutputStream.ComputeInt32Size(28, Field28);
}
if (HasField29) {
size += pb::CodedOutputStream.ComputeStringSize(29, Field29);
}
if (HasField16) {
size += pb::CodedOutputStream.ComputeStringSize(16, Field16);
}
foreach (string element in Field22List) {
size += pb::CodedOutputStream.ComputeStringSize(22, element);
}
foreach (int element in Field73List) {
size += pb::CodedOutputStream.ComputeInt32Size(73, element);
}
if (HasField20) {
size += pb::CodedOutputStream.ComputeInt32Size(20, Field20);
}
if (HasField24) {
size += pb::CodedOutputStream.ComputeStringSize(24, Field24);
}
if (HasField31) {
size += pb::CodedOutputStream.ComputeMessageSize(31, Field31);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
private bool hasField24;
private string field24_ = "";
public bool HasField24 {
get { return hasField24; }
}
public string Field24 {
get { return field24_; }
}
private bool hasField31;
private global::Google.ProtocolBuffers.BenchmarkProtos.Message4 field31_ = global::Google.ProtocolBuffers.BenchmarkProtos.Message4.DefaultInstance;
public bool HasField31 {
get { return hasField31; }
}
public global::Google.ProtocolBuffers.BenchmarkProtos.Message4 Field31 {
get { return field31_; }
}
public static Group1 ParseFrom(pb::ByteString data) {
......@@ -3270,162 +2224,6 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
return returnMe;
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is Group1) {
return MergeFrom((Group1) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(Group1 other) {
if (other == Group1.DefaultInstance) return this;
if (other.HasField11) {
Field11 = other.Field11;
}
if (other.HasField26) {
Field26 = other.Field26;
}
if (other.HasField12) {
Field12 = other.Field12;
}
if (other.HasField13) {
Field13 = other.Field13;
}
if (other.field14_.Count != 0) {
base.AddRange(other.field14_, result.field14_);
}
if (other.HasField15) {
Field15 = other.Field15;
}
if (other.HasField5) {
Field5 = other.Field5;
}
if (other.HasField27) {
Field27 = other.Field27;
}
if (other.HasField28) {
Field28 = other.Field28;
}
if (other.HasField29) {
Field29 = other.Field29;
}
if (other.HasField16) {
Field16 = other.Field16;
}
if (other.field22_.Count != 0) {
base.AddRange(other.field22_, result.field22_);
}
if (other.field73_.Count != 0) {
base.AddRange(other.field73_, result.field73_);
}
if (other.HasField20) {
Field20 = other.Field20;
}
if (other.HasField24) {
Field24 = other.Field24;
}
if (other.HasField31) {
MergeField31(other.Field31);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override Builder MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0: {
this.UnknownFields = unknownFields.Build();
return this;
}
default: {
if (!ParseUnknownField(input, unknownFields, extensionRegistry, tag)) {
this.UnknownFields = unknownFields.Build();
return this;
}
break;
}
case 40: {
Field5 = input.ReadInt32();
break;
}
case 93: {
Field11 = input.ReadFloat();
break;
}
case 98: {
Field12 = input.ReadString();
break;
}
case 106: {
Field13 = input.ReadString();
break;
}
case 114: {
AddField14(input.ReadString());
break;
}
case 120: {
Field15 = input.ReadUInt64();
break;
}
case 130: {
Field16 = input.ReadString();
break;
}
case 160: {
Field20 = input.ReadInt32();
break;
}
case 178: {
AddField22(input.ReadString());
break;
}
case 194: {
Field24 = input.ReadString();
break;
}
case 213: {
Field26 = input.ReadFloat();
break;
}
case 218: {
Field27 = input.ReadString();
break;
}
case 224: {
Field28 = input.ReadInt32();
break;
}
case 234: {
Field29 = input.ReadString();
break;
}
case 250: {
global::Google.ProtocolBuffers.BenchmarkProtos.Message4.Builder subBuilder = global::Google.ProtocolBuffers.BenchmarkProtos.Message4.CreateBuilder();
if (HasField31) {
subBuilder.MergeFrom(Field31);
}
input.ReadMessage(subBuilder, extensionRegistry);
Field31 = subBuilder.BuildPartial();
break;
}
case 584: {
AddField73(input.ReadInt32());
break;
}
}
}
}
public bool HasField11 {
get { return result.HasField11; }
......@@ -4037,209 +2835,6 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
get { return field206_; }
}
public override bool IsInitialized {
get {
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
if (HasField1) {
output.WriteString(1, Field1);
}
if (HasField2) {
output.WriteBytes(2, Field2);
}
if (HasField3) {
output.WriteInt64(3, Field3);
}
if (HasField4) {
output.WriteInt64(4, Field4);
}
if (HasField6) {
output.WriteString(6, Field6);
}
foreach (global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1 element in Group1List) {
output.WriteGroup(10, element);
}
if (HasField21) {
output.WriteInt32(21, Field21);
}
if (HasField25) {
output.WriteFloat(25, Field25);
}
if (HasField30) {
output.WriteInt64(30, Field30);
}
if (HasField63) {
output.WriteInt32(63, Field63);
}
if (HasField71) {
output.WriteInt32(71, Field71);
}
if (HasField75) {
output.WriteBool(75, Field75);
}
if (HasField109) {
output.WriteInt32(109, Field109);
}
foreach (string element in Field127List) {
output.WriteString(127, element);
}
foreach (string element in Field128List) {
output.WriteString(128, element);
}
if (HasField129) {
output.WriteInt32(129, Field129);
}
foreach (long element in Field130List) {
output.WriteInt64(130, element);
}
if (HasField131) {
output.WriteInt64(131, Field131);
}
if (HasField205) {
output.WriteBool(205, Field205);
}
if (HasField206) {
output.WriteBool(206, Field206);
}
if (HasField210) {
output.WriteInt32(210, Field210);
}
if (HasField211) {
output.WriteInt32(211, Field211);
}
if (HasField212) {
output.WriteInt32(212, Field212);
}
if (HasField213) {
output.WriteInt32(213, Field213);
}
if (HasField216) {
output.WriteInt32(216, Field216);
}
if (HasField217) {
output.WriteInt32(217, Field217);
}
if (HasField218) {
output.WriteInt32(218, Field218);
}
if (HasField220) {
output.WriteInt32(220, Field220);
}
if (HasField221) {
output.WriteInt32(221, Field221);
}
if (HasField222) {
output.WriteFloat(222, Field222);
}
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (HasField1) {
size += pb::CodedOutputStream.ComputeStringSize(1, Field1);
}
if (HasField3) {
size += pb::CodedOutputStream.ComputeInt64Size(3, Field3);
}
if (HasField4) {
size += pb::CodedOutputStream.ComputeInt64Size(4, Field4);
}
if (HasField30) {
size += pb::CodedOutputStream.ComputeInt64Size(30, Field30);
}
if (HasField75) {
size += pb::CodedOutputStream.ComputeBoolSize(75, Field75);
}
if (HasField6) {
size += pb::CodedOutputStream.ComputeStringSize(6, Field6);
}
if (HasField2) {
size += pb::CodedOutputStream.ComputeBytesSize(2, Field2);
}
if (HasField21) {
size += pb::CodedOutputStream.ComputeInt32Size(21, Field21);
}
if (HasField71) {
size += pb::CodedOutputStream.ComputeInt32Size(71, Field71);
}
if (HasField25) {
size += pb::CodedOutputStream.ComputeFloatSize(25, Field25);
}
if (HasField109) {
size += pb::CodedOutputStream.ComputeInt32Size(109, Field109);
}
if (HasField210) {
size += pb::CodedOutputStream.ComputeInt32Size(210, Field210);
}
if (HasField211) {
size += pb::CodedOutputStream.ComputeInt32Size(211, Field211);
}
if (HasField212) {
size += pb::CodedOutputStream.ComputeInt32Size(212, Field212);
}
if (HasField213) {
size += pb::CodedOutputStream.ComputeInt32Size(213, Field213);
}
if (HasField216) {
size += pb::CodedOutputStream.ComputeInt32Size(216, Field216);
}
if (HasField217) {
size += pb::CodedOutputStream.ComputeInt32Size(217, Field217);
}
if (HasField218) {
size += pb::CodedOutputStream.ComputeInt32Size(218, Field218);
}
if (HasField220) {
size += pb::CodedOutputStream.ComputeInt32Size(220, Field220);
}
if (HasField221) {
size += pb::CodedOutputStream.ComputeInt32Size(221, Field221);
}
if (HasField222) {
size += pb::CodedOutputStream.ComputeFloatSize(222, Field222);
}
if (HasField63) {
size += pb::CodedOutputStream.ComputeInt32Size(63, Field63);
}
foreach (global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1 element in Group1List) {
size += pb::CodedOutputStream.ComputeGroupSize(10, element);
}
foreach (string element in Field128List) {
size += pb::CodedOutputStream.ComputeStringSize(128, element);
}
if (HasField131) {
size += pb::CodedOutputStream.ComputeInt64Size(131, Field131);
}
foreach (string element in Field127List) {
size += pb::CodedOutputStream.ComputeStringSize(127, element);
}
if (HasField129) {
size += pb::CodedOutputStream.ComputeInt32Size(129, Field129);
}
foreach (long element in Field130List) {
size += pb::CodedOutputStream.ComputeInt64Size(130, element);
}
if (HasField205) {
size += pb::CodedOutputStream.ComputeBoolSize(205, Field205);
}
if (HasField206) {
size += pb::CodedOutputStream.ComputeBoolSize(206, Field206);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
}
public static Message3 ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -4309,257 +2904,6 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
return returnMe;
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is Message3) {
return MergeFrom((Message3) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(Message3 other) {
if (other == Message3.DefaultInstance) return this;
if (other.HasField1) {
Field1 = other.Field1;
}
if (other.HasField3) {
Field3 = other.Field3;
}
if (other.HasField4) {
Field4 = other.Field4;
}
if (other.HasField30) {
Field30 = other.Field30;
}
if (other.HasField75) {
Field75 = other.Field75;
}
if (other.HasField6) {
Field6 = other.Field6;
}
if (other.HasField2) {
Field2 = other.Field2;
}
if (other.HasField21) {
Field21 = other.Field21;
}
if (other.HasField71) {
Field71 = other.Field71;
}
if (other.HasField25) {
Field25 = other.Field25;
}
if (other.HasField109) {
Field109 = other.Field109;
}
if (other.HasField210) {
Field210 = other.Field210;
}
if (other.HasField211) {
Field211 = other.Field211;
}
if (other.HasField212) {
Field212 = other.Field212;
}
if (other.HasField213) {
Field213 = other.Field213;
}
if (other.HasField216) {
Field216 = other.Field216;
}
if (other.HasField217) {
Field217 = other.Field217;
}
if (other.HasField218) {
Field218 = other.Field218;
}
if (other.HasField220) {
Field220 = other.Field220;
}
if (other.HasField221) {
Field221 = other.Field221;
}
if (other.HasField222) {
Field222 = other.Field222;
}
if (other.HasField63) {
Field63 = other.Field63;
}
if (other.group1_.Count != 0) {
base.AddRange(other.group1_, result.group1_);
}
if (other.field128_.Count != 0) {
base.AddRange(other.field128_, result.field128_);
}
if (other.HasField131) {
Field131 = other.Field131;
}
if (other.field127_.Count != 0) {
base.AddRange(other.field127_, result.field127_);
}
if (other.HasField129) {
Field129 = other.Field129;
}
if (other.field130_.Count != 0) {
base.AddRange(other.field130_, result.field130_);
}
if (other.HasField205) {
Field205 = other.Field205;
}
if (other.HasField206) {
Field206 = other.Field206;
}
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override Builder MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0: {
this.UnknownFields = unknownFields.Build();
return this;
}
default: {
if (!ParseUnknownField(input, unknownFields, extensionRegistry, tag)) {
this.UnknownFields = unknownFields.Build();
return this;
}
break;
}
case 10: {
Field1 = input.ReadString();
break;
}
case 18: {
Field2 = input.ReadBytes();
break;
}
case 24: {
Field3 = input.ReadInt64();
break;
}
case 32: {
Field4 = input.ReadInt64();
break;
}
case 50: {
Field6 = input.ReadString();
break;
}
case 83: {
global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1.Builder subBuilder = global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1.CreateBuilder();
input.ReadGroup(10, subBuilder, extensionRegistry);
AddGroup1(subBuilder.BuildPartial());
break;
}
case 168: {
Field21 = input.ReadInt32();
break;
}
case 205: {
Field25 = input.ReadFloat();
break;
}
case 240: {
Field30 = input.ReadInt64();
break;
}
case 504: {
Field63 = input.ReadInt32();
break;
}
case 568: {
Field71 = input.ReadInt32();
break;
}
case 600: {
Field75 = input.ReadBool();
break;
}
case 872: {
Field109 = input.ReadInt32();
break;
}
case 1018: {
AddField127(input.ReadString());
break;
}
case 1026: {
AddField128(input.ReadString());
break;
}
case 1032: {
Field129 = input.ReadInt32();
break;
}
case 1040: {
AddField130(input.ReadInt64());
break;
}
case 1048: {
Field131 = input.ReadInt64();
break;
}
case 1640: {
Field205 = input.ReadBool();
break;
}
case 1648: {
Field206 = input.ReadBool();
break;
}
case 1680: {
Field210 = input.ReadInt32();
break;
}
case 1688: {
Field211 = input.ReadInt32();
break;
}
case 1696: {
Field212 = input.ReadInt32();
break;
}
case 1704: {
Field213 = input.ReadInt32();
break;
}
case 1728: {
Field216 = input.ReadInt32();
break;
}
case 1736: {
Field217 = input.ReadInt32();
break;
}
case 1744: {
Field218 = input.ReadInt32();
break;
}
case 1760: {
Field220 = input.ReadInt32();
break;
}
case 1768: {
Field221 = input.ReadInt32();
break;
}
case 1781: {
Field222 = input.ReadFloat();
break;
}
}
}
}
public bool HasField1 {
get { return result.HasField1; }
......@@ -5264,95 +3608,6 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
get { return field11_; }
}
public override bool IsInitialized {
get {
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
if (HasField1) {
output.WriteFloat(1, Field1);
}
if (HasField2) {
output.WriteFloat(2, Field2);
}
if (HasField3) {
output.WriteFloat(3, Field3);
}
if (HasField4) {
output.WriteBool(4, Field4);
}
if (HasField5) {
output.WriteBool(5, Field5);
}
if (HasField6) {
output.WriteBool(6, Field6);
}
if (HasField7) {
output.WriteBool(7, Field7);
}
if (HasField8) {
output.WriteFloat(8, Field8);
}
if (HasField9) {
output.WriteBool(9, Field9);
}
if (HasField10) {
output.WriteFloat(10, Field10);
}
if (HasField11) {
output.WriteInt64(11, Field11);
}
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (HasField1) {
size += pb::CodedOutputStream.ComputeFloatSize(1, Field1);
}
if (HasField2) {
size += pb::CodedOutputStream.ComputeFloatSize(2, Field2);
}
if (HasField3) {
size += pb::CodedOutputStream.ComputeFloatSize(3, Field3);
}
if (HasField4) {
size += pb::CodedOutputStream.ComputeBoolSize(4, Field4);
}
if (HasField5) {
size += pb::CodedOutputStream.ComputeBoolSize(5, Field5);
}
if (HasField6) {
size += pb::CodedOutputStream.ComputeBoolSize(6, Field6);
}
if (HasField7) {
size += pb::CodedOutputStream.ComputeBoolSize(7, Field7);
}
if (HasField8) {
size += pb::CodedOutputStream.ComputeFloatSize(8, Field8);
}
if (HasField9) {
size += pb::CodedOutputStream.ComputeBoolSize(9, Field9);
}
if (HasField10) {
size += pb::CodedOutputStream.ComputeFloatSize(10, Field10);
}
if (HasField11) {
size += pb::CodedOutputStream.ComputeInt64Size(11, Field11);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
}
public static Message4 ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -5418,122 +3673,6 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
return returnMe;
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is Message4) {
return MergeFrom((Message4) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(Message4 other) {
if (other == Message4.DefaultInstance) return this;
if (other.HasField1) {
Field1 = other.Field1;
}
if (other.HasField2) {
Field2 = other.Field2;
}
if (other.HasField3) {
Field3 = other.Field3;
}
if (other.HasField4) {
Field4 = other.Field4;
}
if (other.HasField5) {
Field5 = other.Field5;
}
if (other.HasField6) {
Field6 = other.Field6;
}
if (other.HasField7) {
Field7 = other.Field7;
}
if (other.HasField8) {
Field8 = other.Field8;
}
if (other.HasField9) {
Field9 = other.Field9;
}
if (other.HasField10) {
Field10 = other.Field10;
}
if (other.HasField11) {
Field11 = other.Field11;
}
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override Builder MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0: {
this.UnknownFields = unknownFields.Build();
return this;
}
default: {
if (!ParseUnknownField(input, unknownFields, extensionRegistry, tag)) {
this.UnknownFields = unknownFields.Build();
return this;
}
break;
}
case 13: {
Field1 = input.ReadFloat();
break;
}
case 21: {
Field2 = input.ReadFloat();
break;
}
case 29: {
Field3 = input.ReadFloat();
break;
}
case 32: {
Field4 = input.ReadBool();
break;
}
case 40: {
Field5 = input.ReadBool();
break;
}
case 48: {
Field6 = input.ReadBool();
break;
}
case 56: {
Field7 = input.ReadBool();
break;
}
case 69: {
Field8 = input.ReadFloat();
break;
}
case 72: {
Field9 = input.ReadBool();
break;
}
case 85: {
Field10 = input.ReadFloat();
break;
}
case 88: {
Field11 = input.ReadInt64();
break;
}
}
}
}
public bool HasField1 {
get { return result.HasField1; }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -16,49 +16,67 @@ namespace ProtoBench {
delegate void Action();
public static int Main(string[] args) {
if (args.Length != 2) {
Console.Error.WriteLine("Usage: ProtoBecnh <descriptor type name> <input data>");
if (args.Length < 2 || (args.Length % 2) != 0) {
Console.Error.WriteLine("Usage: ProtoBench <descriptor type name> <input data>");
Console.Error.WriteLine("The descriptor type name is the fully-qualified message name,");
Console.Error.WriteLine("including assembly - e.g. Google.ProtocolBuffers.BenchmarkProtos.Message1,ProtoBench");
Console.Error.WriteLine("(You can specify multiple pairs of descriptor type name and input data.)");
return 1;
}
bool success = true;
for (int i = 0; i < args.Length; i += 2) {
success &= RunTest(args[i], args[i + 1]);
}
return success ? 0 : 1;
}
/// <summary>
/// Runs a single test. Error messages are displayed to Console.Error, and the return value indicates
/// general success/failure.
/// </summary>
public static bool RunTest(string typeName, string file) {
Console.WriteLine("Benchmarking {0} with file {1}", typeName, file);
IMessage defaultMessage;
try {
defaultMessage = MessageUtil.GetDefaultMessage(args[0]);
defaultMessage = MessageUtil.GetDefaultMessage(typeName);
} catch (ArgumentException e) {
Console.Error.WriteLine(e.Message);
return 1;
return false;
}
try {
IBuilder builder = defaultMessage.WeakCreateBuilderForType();
byte[] inputData = File.ReadAllBytes(args[1]);
byte[] inputData = File.ReadAllBytes(file);
MemoryStream inputStream = new MemoryStream(inputData);
ByteString inputString = ByteString.CopyFrom(inputData);
IMessage sampleMessage = defaultMessage.WeakCreateBuilderForType().WeakMergeFrom(inputString).WeakBuild();
sampleMessage.ToByteString();
Console.WriteLine("Benchmarking {0} with file {1}", sampleMessage.GetType().Name, args[1]);
Benchmark("Serialize to byte string", inputData.Length, () => sampleMessage.ToByteString());
Benchmark("Serialize to byte array", inputData.Length, () => sampleMessage.ToByteArray());
Benchmark("Serialize to memory stream", inputData.Length, () => sampleMessage.WriteTo(new MemoryStream()));
Benchmark("Deserialize from byte string", inputData.Length, () =>
defaultMessage.WeakCreateBuilderForType()
.WeakMergeFrom(inputString)
.WeakBuild()
);
Benchmark("Deserialize from byte array", inputData.Length, () =>
defaultMessage.WeakCreateBuilderForType()
.WeakMergeFrom(CodedInputStream.CreateInstance(inputData))
.WeakBuild()
);
Benchmark("Deserialize from byte array", inputData.Length, () =>
Benchmark("Deserialize from memory stream", inputData.Length, () =>
defaultMessage.WeakCreateBuilderForType()
.WeakMergeFrom(inputString)
.WeakMergeFrom(CodedInputStream.CreateInstance(inputStream))
.WeakBuild()
);
return 0;
return true;
} catch (Exception e) {
Console.Error.WriteLine("Error: {0}", e.Message);
Console.Error.WriteLine();
Console.Error.WriteLine("Detailed exception information: {0}", e);
return 1;
return false;
}
}
private static void Benchmark(string name, int dataSize, Action action) {
private static void Benchmark(string name, long dataSize, Action action) {
// Make sure it's JITted
action();
// Run it progressively more times until we've got a reasonable sample
......
......@@ -39,6 +39,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BenchmarkProtoFile.cs" />
<Compile Include="BenchmarkSpeedProtoFile.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment