Commit a3767341 authored by Jon Skeet's avatar Jon Skeet

Changed benchmark namespace and fixed enum issue

parent 79c72a99
...@@ -178,13 +178,13 @@ ...@@ -178,13 +178,13 @@
description="Runs all performance tests"> description="Runs all performance tests">
<exec program="${tools-protobench}" <exec program="${tools-protobench}"
workingdir="${testdata-dir}"> workingdir="${testdata-dir}">
<arg value="Google.ProtocolBuffers.BenchmarkProtos.Message1,ProtoBench" /> <arg value="Google.ProtocolBuffers.ProtoBench.Message1,ProtoBench" />
<arg value="benchmark_message1.dat" /> <arg value="benchmark_message1.dat" />
<arg value="Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage1,ProtoBench" /> <arg value="Google.ProtocolBuffers.ProtoBench.SpeedMessage1,ProtoBench" />
<arg value="benchmark_message1.dat" /> <arg value="benchmark_message1.dat" />
<arg value="Google.ProtocolBuffers.BenchmarkProtos.Message3,ProtoBench" /> <arg value="Google.ProtocolBuffers.ProtoBench.Message3,ProtoBench" />
<arg value="benchmark_message3.dat" /> <arg value="benchmark_message3.dat" />
<arg value="Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3,ProtoBench" /> <arg value="Google.ProtocolBuffers.ProtoBench.SpeedMessage3,ProtoBench" />
<arg value="benchmark_message3.dat" /> <arg value="benchmark_message3.dat" />
</exec> </exec>
</target> </target>
......
import "google/protobuf/csharp_options.proto"; import "google/protobuf/csharp_options.proto";
option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.BenchmarkProtos"; option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.ProtoBench";
option (google.protobuf.csharp_file_options).umbrella_classname = "BenchmarkProtoFile"; option (google.protobuf.csharp_file_options).umbrella_classname = "BenchmarkProtoFile";
package proto2.benchmark.v2_api; package proto2.benchmark.v2_api;
......
import "google/protobuf/csharp_options.proto"; import "google/protobuf/csharp_options.proto";
option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.BenchmarkProtos"; option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.ProtoBench";
option (google.protobuf.csharp_file_options).umbrella_classname = "BenchmarkSpeedProtoFile"; option (google.protobuf.csharp_file_options).umbrella_classname = "BenchmarkSpeedProtoFile";
package proto2.benchmark.v2_api; package proto2.benchmark.v2_api;
......
...@@ -4,7 +4,7 @@ using pb = global::Google.ProtocolBuffers; ...@@ -4,7 +4,7 @@ using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections; using pbc = global::Google.ProtocolBuffers.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors; using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic; using scg = global::System.Collections.Generic;
namespace Google.ProtocolBuffers.BenchmarkProtos { namespace Google.ProtocolBuffers.ProtoBench {
public static partial class BenchmarkProtoFile { public static partial class BenchmarkProtoFile {
...@@ -70,9 +70,9 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -70,9 +70,9 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
"Eg4KBmZpZWxkMhgCIAEoAhIRCgZmaWVsZDMYAyABKAI6ATASDgoGZmllbGQ0" + "Eg4KBmZpZWxkMhgCIAEoAhIRCgZmaWVsZDMYAyABKAI6ATASDgoGZmllbGQ0" +
"GAQgASgIEg4KBmZpZWxkNRgFIAEoCBIUCgZmaWVsZDYYBiABKAg6BHRydWUS" + "GAQgASgIEg4KBmZpZWxkNRgFIAEoCBIUCgZmaWVsZDYYBiABKAg6BHRydWUS" +
"FQoGZmllbGQ3GAcgASgIOgVmYWxzZRIOCgZmaWVsZDgYCCABKAISDgoGZmll" + "FQoGZmllbGQ3GAcgASgIOgVmYWxzZRIOCgZmaWVsZDgYCCABKAISDgoGZmll" +
"bGQ5GAkgASgIEg8KB2ZpZWxkMTAYCiABKAISDwoHZmllbGQxMRgLIAEoA0I/" + "bGQ5GAkgASgIEg8KB2ZpZWxkMTAYCiABKAISDwoHZmllbGQxMRgLIAEoA0I6" +
"wj48CiZHb29nbGUuUHJvdG9jb2xCdWZmZXJzLkJlbmNobWFya1Byb3RvcxIS" + "wj43CiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlByb3RvQmVuY2gSEkJlbmNo" +
"QmVuY2htYXJrUHJvdG9GaWxl"), "bWFya1Byb3RvRmlsZQ=="),
new pbd::FileDescriptor[] { new pbd::FileDescriptor[] {
global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor,
}); });
...@@ -81,28 +81,28 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -81,28 +81,28 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
#region Static variables #region Static variables
internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_Message1__Descriptor internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_Message1__Descriptor
= Descriptor.MessageTypes[0]; = Descriptor.MessageTypes[0];
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.Message1, global::Google.ProtocolBuffers.BenchmarkProtos.Message1.Builder> internal__static_proto2_benchmark_v2_api_Message1__FieldAccessorTable internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.Message1, global::Google.ProtocolBuffers.ProtoBench.Message1.Builder> internal__static_proto2_benchmark_v2_api_Message1__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.Message1, global::Google.ProtocolBuffers.BenchmarkProtos.Message1.Builder>(internal__static_proto2_benchmark_v2_api_Message1__Descriptor, = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.Message1, global::Google.ProtocolBuffers.ProtoBench.Message1.Builder>(internal__static_proto2_benchmark_v2_api_Message1__Descriptor,
new string[] { "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131", }); new string[] { "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131", });
internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_Message2__Descriptor internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_Message2__Descriptor
= Descriptor.MessageTypes[1]; = Descriptor.MessageTypes[1];
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.Message2, global::Google.ProtocolBuffers.BenchmarkProtos.Message2.Builder> internal__static_proto2_benchmark_v2_api_Message2__FieldAccessorTable internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.Message2, global::Google.ProtocolBuffers.ProtoBench.Message2.Builder> internal__static_proto2_benchmark_v2_api_Message2__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.Message2, global::Google.ProtocolBuffers.BenchmarkProtos.Message2.Builder>(internal__static_proto2_benchmark_v2_api_Message2__Descriptor, = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.Message2, global::Google.ProtocolBuffers.ProtoBench.Message2.Builder>(internal__static_proto2_benchmark_v2_api_Message2__Descriptor,
new string[] { "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300", }); new string[] { "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300", });
internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_Message3__Descriptor internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_Message3__Descriptor
= Descriptor.MessageTypes[2]; = Descriptor.MessageTypes[2];
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.Message3, global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Builder> internal__static_proto2_benchmark_v2_api_Message3__FieldAccessorTable internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.Message3, global::Google.ProtocolBuffers.ProtoBench.Message3.Builder> internal__static_proto2_benchmark_v2_api_Message3__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.Message3, global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Builder>(internal__static_proto2_benchmark_v2_api_Message3__Descriptor, = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.Message3, global::Google.ProtocolBuffers.ProtoBench.Message3.Builder>(internal__static_proto2_benchmark_v2_api_Message3__Descriptor,
new string[] { "Field1", "Field3", "Field4", "Field30", "Field75", "Field6", "Field2", "Field21", "Field71", "Field25", "Field109", "Field210", "Field211", "Field212", "Field213", "Field216", "Field217", "Field218", "Field220", "Field221", "Field222", "Field63", "Group1", "Field128", "Field131", "Field127", "Field129", "Field130", "Field205", "Field206", }); new string[] { "Field1", "Field3", "Field4", "Field30", "Field75", "Field6", "Field2", "Field21", "Field71", "Field25", "Field109", "Field210", "Field211", "Field212", "Field213", "Field216", "Field217", "Field218", "Field220", "Field221", "Field222", "Field63", "Group1", "Field128", "Field131", "Field127", "Field129", "Field130", "Field205", "Field206", });
internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_Message3_Group1__Descriptor internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_Message3_Group1__Descriptor
= internal__static_proto2_benchmark_v2_api_Message3__Descriptor.NestedTypes[0]; = internal__static_proto2_benchmark_v2_api_Message3__Descriptor.NestedTypes[0];
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1, global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1.Builder> internal__static_proto2_benchmark_v2_api_Message3_Group1__FieldAccessorTable internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1, global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1.Builder> internal__static_proto2_benchmark_v2_api_Message3_Group1__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1, global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1.Builder>(internal__static_proto2_benchmark_v2_api_Message3_Group1__Descriptor, = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1, global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1.Builder>(internal__static_proto2_benchmark_v2_api_Message3_Group1__Descriptor,
new string[] { "Field11", "Field26", "Field12", "Field13", "Field14", "Field15", "Field5", "Field27", "Field28", "Field29", "Field16", "Field22", "Field73", "Field20", "Field24", "Field31", }); new string[] { "Field11", "Field26", "Field12", "Field13", "Field14", "Field15", "Field5", "Field27", "Field28", "Field29", "Field16", "Field22", "Field73", "Field20", "Field24", "Field31", });
internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_Message4__Descriptor internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_Message4__Descriptor
= Descriptor.MessageTypes[3]; = Descriptor.MessageTypes[3];
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.Message4, global::Google.ProtocolBuffers.BenchmarkProtos.Message4.Builder> internal__static_proto2_benchmark_v2_api_Message4__FieldAccessorTable internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.Message4, global::Google.ProtocolBuffers.ProtoBench.Message4.Builder> internal__static_proto2_benchmark_v2_api_Message4__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.Message4, global::Google.ProtocolBuffers.BenchmarkProtos.Message4.Builder>(internal__static_proto2_benchmark_v2_api_Message4__Descriptor, = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.Message4, global::Google.ProtocolBuffers.ProtoBench.Message4.Builder>(internal__static_proto2_benchmark_v2_api_Message4__Descriptor,
new string[] { "Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", }); new string[] { "Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", });
#endregion #endregion
} }
...@@ -122,11 +122,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -122,11 +122,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public static pbd::MessageDescriptor Descriptor { public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message1__Descriptor; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message1__Descriptor; }
} }
protected override pb::FieldAccess.FieldAccessorTable<Message1, Message1.Builder> InternalFieldAccessors { protected override pb::FieldAccess.FieldAccessorTable<Message1, Message1.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message1__FieldAccessorTable; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message1__FieldAccessorTable; }
} }
private bool hasField1; private bool hasField1;
...@@ -438,11 +438,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -438,11 +438,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
private bool hasField15; private bool hasField15;
private global::Google.ProtocolBuffers.BenchmarkProtos.Message2 field15_ = global::Google.ProtocolBuffers.BenchmarkProtos.Message2.DefaultInstance; private global::Google.ProtocolBuffers.ProtoBench.Message2 field15_ = global::Google.ProtocolBuffers.ProtoBench.Message2.DefaultInstance;
public bool HasField15 { public bool HasField15 {
get { return hasField15; } get { return hasField15; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.Message2 Field15 { public global::Google.ProtocolBuffers.ProtoBench.Message2 Field15 {
get { return field15_; } get { return field15_; }
} }
...@@ -1190,24 +1190,24 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -1190,24 +1190,24 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
public bool HasField15 { public bool HasField15 {
get { return result.HasField15; } get { return result.HasField15; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.Message2 Field15 { public global::Google.ProtocolBuffers.ProtoBench.Message2 Field15 {
get { return result.Field15; } get { return result.Field15; }
set { SetField15(value); } set { SetField15(value); }
} }
public Builder SetField15(global::Google.ProtocolBuffers.BenchmarkProtos.Message2 value) { public Builder SetField15(global::Google.ProtocolBuffers.ProtoBench.Message2 value) {
result.hasField15 = true; result.hasField15 = true;
result.field15_ = value; result.field15_ = value;
return this; return this;
} }
public Builder SetField15(global::Google.ProtocolBuffers.BenchmarkProtos.Message2.Builder builderForValue) { public Builder SetField15(global::Google.ProtocolBuffers.ProtoBench.Message2.Builder builderForValue) {
result.hasField15 = true; result.hasField15 = true;
result.field15_ = builderForValue.Build(); result.field15_ = builderForValue.Build();
return this; return this;
} }
public Builder MergeField15(global::Google.ProtocolBuffers.BenchmarkProtos.Message2 value) { public Builder MergeField15(global::Google.ProtocolBuffers.ProtoBench.Message2 value) {
if (result.HasField15 && if (result.HasField15 &&
result.field15_ != global::Google.ProtocolBuffers.BenchmarkProtos.Message2.DefaultInstance) { result.field15_ != global::Google.ProtocolBuffers.ProtoBench.Message2.DefaultInstance) {
result.field15_ = global::Google.ProtocolBuffers.BenchmarkProtos.Message2.CreateBuilder(result.field15_).MergeFrom(value).BuildPartial(); result.field15_ = global::Google.ProtocolBuffers.ProtoBench.Message2.CreateBuilder(result.field15_).MergeFrom(value).BuildPartial();
} else { } else {
result.field15_ = value; result.field15_ = value;
} }
...@@ -1216,7 +1216,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -1216,7 +1216,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public Builder ClearField15() { public Builder ClearField15() {
result.hasField15 = false; result.hasField15 = false;
result.field15_ = global::Google.ProtocolBuffers.BenchmarkProtos.Message2.DefaultInstance; result.field15_ = global::Google.ProtocolBuffers.ProtoBench.Message2.DefaultInstance;
return this; return this;
} }
...@@ -1345,11 +1345,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -1345,11 +1345,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public static pbd::MessageDescriptor Descriptor { public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message2__Descriptor; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message2__Descriptor; }
} }
protected override pb::FieldAccess.FieldAccessorTable<Message2, Message2.Builder> InternalFieldAccessors { protected override pb::FieldAccess.FieldAccessorTable<Message2, Message2.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message2__FieldAccessorTable; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message2__FieldAccessorTable; }
} }
private bool hasField1; private bool hasField1;
...@@ -1975,11 +1975,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -1975,11 +1975,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public static pbd::MessageDescriptor Descriptor { public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message3__Descriptor; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message3__Descriptor; }
} }
protected override pb::FieldAccess.FieldAccessorTable<Message3, Message3.Builder> InternalFieldAccessors { protected override pb::FieldAccess.FieldAccessorTable<Message3, Message3.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message3__FieldAccessorTable; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message3__FieldAccessorTable; }
} }
#region Nested types #region Nested types
...@@ -1999,11 +1999,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -1999,11 +1999,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public static pbd::MessageDescriptor Descriptor { public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message3_Group1__Descriptor; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message3_Group1__Descriptor; }
} }
protected override pb::FieldAccess.FieldAccessorTable<Group1, Group1.Builder> InternalFieldAccessors { protected override pb::FieldAccess.FieldAccessorTable<Group1, Group1.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message3_Group1__FieldAccessorTable; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message3_Group1__FieldAccessorTable; }
} }
private bool hasField11; private bool hasField11;
...@@ -2148,11 +2148,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -2148,11 +2148,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
private bool hasField31; private bool hasField31;
private global::Google.ProtocolBuffers.BenchmarkProtos.Message4 field31_ = global::Google.ProtocolBuffers.BenchmarkProtos.Message4.DefaultInstance; private global::Google.ProtocolBuffers.ProtoBench.Message4 field31_ = global::Google.ProtocolBuffers.ProtoBench.Message4.DefaultInstance;
public bool HasField31 { public bool HasField31 {
get { return hasField31; } get { return hasField31; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.Message4 Field31 { public global::Google.ProtocolBuffers.ProtoBench.Message4 Field31 {
get { return field31_; } get { return field31_; }
} }
...@@ -2522,24 +2522,24 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -2522,24 +2522,24 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
public bool HasField31 { public bool HasField31 {
get { return result.HasField31; } get { return result.HasField31; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.Message4 Field31 { public global::Google.ProtocolBuffers.ProtoBench.Message4 Field31 {
get { return result.Field31; } get { return result.Field31; }
set { SetField31(value); } set { SetField31(value); }
} }
public Builder SetField31(global::Google.ProtocolBuffers.BenchmarkProtos.Message4 value) { public Builder SetField31(global::Google.ProtocolBuffers.ProtoBench.Message4 value) {
result.hasField31 = true; result.hasField31 = true;
result.field31_ = value; result.field31_ = value;
return this; return this;
} }
public Builder SetField31(global::Google.ProtocolBuffers.BenchmarkProtos.Message4.Builder builderForValue) { public Builder SetField31(global::Google.ProtocolBuffers.ProtoBench.Message4.Builder builderForValue) {
result.hasField31 = true; result.hasField31 = true;
result.field31_ = builderForValue.Build(); result.field31_ = builderForValue.Build();
return this; return this;
} }
public Builder MergeField31(global::Google.ProtocolBuffers.BenchmarkProtos.Message4 value) { public Builder MergeField31(global::Google.ProtocolBuffers.ProtoBench.Message4 value) {
if (result.HasField31 && if (result.HasField31 &&
result.field31_ != global::Google.ProtocolBuffers.BenchmarkProtos.Message4.DefaultInstance) { result.field31_ != global::Google.ProtocolBuffers.ProtoBench.Message4.DefaultInstance) {
result.field31_ = global::Google.ProtocolBuffers.BenchmarkProtos.Message4.CreateBuilder(result.field31_).MergeFrom(value).BuildPartial(); result.field31_ = global::Google.ProtocolBuffers.ProtoBench.Message4.CreateBuilder(result.field31_).MergeFrom(value).BuildPartial();
} else { } else {
result.field31_ = value; result.field31_ = value;
} }
...@@ -2548,7 +2548,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -2548,7 +2548,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public Builder ClearField31() { public Builder ClearField31() {
result.hasField31 = false; result.hasField31 = false;
result.field31_ = global::Google.ProtocolBuffers.BenchmarkProtos.Message4.DefaultInstance; result.field31_ = global::Google.ProtocolBuffers.ProtoBench.Message4.DefaultInstance;
return this; return this;
} }
} }
...@@ -2755,14 +2755,14 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -2755,14 +2755,14 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
get { return field63_; } get { return field63_; }
} }
private pbc::PopsicleList<global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1> group1_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1>(); private pbc::PopsicleList<global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1> group1_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1>();
public scg::IList<global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1> Group1List { public scg::IList<global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1> Group1List {
get { return group1_; } get { return group1_; }
} }
public int Group1Count { public int Group1Count {
get { return group1_.Count; } get { return group1_.Count; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1 GetGroup1(int index) { public global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1 GetGroup1(int index) {
return group1_[index]; return group1_[index];
} }
...@@ -3301,32 +3301,32 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -3301,32 +3301,32 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
return this; return this;
} }
public scg::IList<global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1> Group1List { public scg::IList<global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1> Group1List {
get { return result.group1_; } get { return result.group1_; }
} }
public int Group1Count { public int Group1Count {
get { return result.Group1Count; } get { return result.Group1Count; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1 GetGroup1(int index) { public global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1 GetGroup1(int index) {
return result.GetGroup1(index); return result.GetGroup1(index);
} }
public Builder SetGroup1(int index, global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1 value) { public Builder SetGroup1(int index, global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1 value) {
result.group1_[index] = value; result.group1_[index] = value;
return this; return this;
} }
public Builder SetGroup1(int index, global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1.Builder builderForValue) { public Builder SetGroup1(int index, global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1.Builder builderForValue) {
result.group1_[index] = builderForValue.Build(); result.group1_[index] = builderForValue.Build();
return this; return this;
} }
public Builder AddGroup1(global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1 value) { public Builder AddGroup1(global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1 value) {
result.group1_.Add(value); result.group1_.Add(value);
return this; return this;
} }
public Builder AddGroup1(global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1.Builder builderForValue) { public Builder AddGroup1(global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1.Builder builderForValue) {
result.group1_.Add(builderForValue.Build()); result.group1_.Add(builderForValue.Build());
return this; return this;
} }
public Builder AddRangeGroup1(scg::IEnumerable<global::Google.ProtocolBuffers.BenchmarkProtos.Message3.Types.Group1> values) { public Builder AddRangeGroup1(scg::IEnumerable<global::Google.ProtocolBuffers.ProtoBench.Message3.Types.Group1> values) {
base.AddRange(values, result.group1_); base.AddRange(values, result.group1_);
return this; return this;
} }
...@@ -3502,11 +3502,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -3502,11 +3502,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public static pbd::MessageDescriptor Descriptor { public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message4__Descriptor; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message4__Descriptor; }
} }
protected override pb::FieldAccess.FieldAccessorTable<Message4, Message4.Builder> InternalFieldAccessors { protected override pb::FieldAccess.FieldAccessorTable<Message4, Message4.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message4__FieldAccessorTable; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkProtoFile.internal__static_proto2_benchmark_v2_api_Message4__FieldAccessorTable; }
} }
private bool hasField1; private bool hasField1;
......
...@@ -4,7 +4,7 @@ using pb = global::Google.ProtocolBuffers; ...@@ -4,7 +4,7 @@ using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections; using pbc = global::Google.ProtocolBuffers.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors; using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic; using scg = global::System.Collections.Generic;
namespace Google.ProtocolBuffers.BenchmarkProtos { namespace Google.ProtocolBuffers.ProtoBench {
public static partial class BenchmarkSpeedProtoFile { public static partial class BenchmarkSpeedProtoFile {
...@@ -71,9 +71,9 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -71,9 +71,9 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
"ZmllbGQyGAIgASgCEhEKBmZpZWxkMxgDIAEoAjoBMBIOCgZmaWVsZDQYBCAB" + "ZmllbGQyGAIgASgCEhEKBmZpZWxkMxgDIAEoAjoBMBIOCgZmaWVsZDQYBCAB" +
"KAgSDgoGZmllbGQ1GAUgASgIEhQKBmZpZWxkNhgGIAEoCDoEdHJ1ZRIVCgZm" + "KAgSDgoGZmllbGQ1GAUgASgIEhQKBmZpZWxkNhgGIAEoCDoEdHJ1ZRIVCgZm" +
"aWVsZDcYByABKAg6BWZhbHNlEg4KBmZpZWxkOBgIIAEoAhIOCgZmaWVsZDkY" + "aWVsZDcYByABKAg6BWZhbHNlEg4KBmZpZWxkOBgIIAEoAhIOCgZmaWVsZDkY" +
"CSABKAgSDwoHZmllbGQxMBgKIAEoAhIPCgdmaWVsZDExGAsgASgDQkZIAcI+" + "CSABKAgSDwoHZmllbGQxMBgKIAEoAhIPCgdmaWVsZDExGAsgASgDQkFIAcI+" +
"QQomR29vZ2xlLlByb3RvY29sQnVmZmVycy5CZW5jaG1hcmtQcm90b3MSF0Jl" + "PAohR29vZ2xlLlByb3RvY29sQnVmZmVycy5Qcm90b0JlbmNoEhdCZW5jaG1h" +
"bmNobWFya1NwZWVkUHJvdG9GaWxl"), "cmtTcGVlZFByb3RvRmlsZQ=="),
new pbd::FileDescriptor[] { new pbd::FileDescriptor[] {
global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor,
}); });
...@@ -82,28 +82,28 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -82,28 +82,28 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
#region Static variables #region Static variables
internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_SpeedMessage1__Descriptor internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_SpeedMessage1__Descriptor
= Descriptor.MessageTypes[0]; = Descriptor.MessageTypes[0];
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage1, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage1.Builder> internal__static_proto2_benchmark_v2_api_SpeedMessage1__FieldAccessorTable internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1.Builder> internal__static_proto2_benchmark_v2_api_SpeedMessage1__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage1, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage1.Builder>(internal__static_proto2_benchmark_v2_api_SpeedMessage1__Descriptor, = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1.Builder>(internal__static_proto2_benchmark_v2_api_SpeedMessage1__Descriptor,
new string[] { "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131", }); new string[] { "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131", });
internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_SpeedMessage2__Descriptor internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_SpeedMessage2__Descriptor
= Descriptor.MessageTypes[1]; = Descriptor.MessageTypes[1];
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2.Builder> internal__static_proto2_benchmark_v2_api_SpeedMessage2__FieldAccessorTable internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Builder> internal__static_proto2_benchmark_v2_api_SpeedMessage2__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2.Builder>(internal__static_proto2_benchmark_v2_api_SpeedMessage2__Descriptor, = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Builder>(internal__static_proto2_benchmark_v2_api_SpeedMessage2__Descriptor,
new string[] { "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300", }); new string[] { "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300", });
internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_SpeedMessage3__Descriptor internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_SpeedMessage3__Descriptor
= Descriptor.MessageTypes[2]; = Descriptor.MessageTypes[2];
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Builder> internal__static_proto2_benchmark_v2_api_SpeedMessage3__FieldAccessorTable internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Builder> internal__static_proto2_benchmark_v2_api_SpeedMessage3__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Builder>(internal__static_proto2_benchmark_v2_api_SpeedMessage3__Descriptor, = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Builder>(internal__static_proto2_benchmark_v2_api_SpeedMessage3__Descriptor,
new string[] { "Field1", "Field3", "Field4", "Field30", "Field75", "Field6", "Field2", "Field21", "Field71", "Field25", "Field109", "Field210", "Field211", "Field212", "Field213", "Field216", "Field217", "Field218", "Field220", "Field221", "Field222", "Field63", "Group1", "Field128", "Field131", "Field127", "Field129", "Field130", "Field205", "Field206", }); new string[] { "Field1", "Field3", "Field4", "Field30", "Field75", "Field6", "Field2", "Field21", "Field71", "Field25", "Field109", "Field210", "Field211", "Field212", "Field213", "Field216", "Field217", "Field218", "Field220", "Field221", "Field222", "Field63", "Group1", "Field128", "Field131", "Field127", "Field129", "Field130", "Field205", "Field206", });
internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_SpeedMessage3_Group1__Descriptor internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_SpeedMessage3_Group1__Descriptor
= internal__static_proto2_benchmark_v2_api_SpeedMessage3__Descriptor.NestedTypes[0]; = internal__static_proto2_benchmark_v2_api_SpeedMessage3__Descriptor.NestedTypes[0];
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1.Builder> internal__static_proto2_benchmark_v2_api_SpeedMessage3_Group1__FieldAccessorTable internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1.Builder> internal__static_proto2_benchmark_v2_api_SpeedMessage3_Group1__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1.Builder>(internal__static_proto2_benchmark_v2_api_SpeedMessage3_Group1__Descriptor, = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1.Builder>(internal__static_proto2_benchmark_v2_api_SpeedMessage3_Group1__Descriptor,
new string[] { "Field11", "Field26", "Field12", "Field13", "Field14", "Field15", "Field5", "Field27", "Field28", "Field29", "Field16", "Field22", "Field73", "Field20", "Field24", "Field31", }); new string[] { "Field11", "Field26", "Field12", "Field13", "Field14", "Field15", "Field5", "Field27", "Field28", "Field29", "Field16", "Field22", "Field73", "Field20", "Field24", "Field31", });
internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_SpeedMessage4__Descriptor internal static readonly pbd::MessageDescriptor internal__static_proto2_benchmark_v2_api_SpeedMessage4__Descriptor
= Descriptor.MessageTypes[3]; = Descriptor.MessageTypes[3];
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4.Builder> internal__static_proto2_benchmark_v2_api_SpeedMessage4__FieldAccessorTable internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4.Builder> internal__static_proto2_benchmark_v2_api_SpeedMessage4__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4.Builder>(internal__static_proto2_benchmark_v2_api_SpeedMessage4__Descriptor, = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4.Builder>(internal__static_proto2_benchmark_v2_api_SpeedMessage4__Descriptor,
new string[] { "Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", }); new string[] { "Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", });
#endregion #endregion
} }
...@@ -123,11 +123,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -123,11 +123,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public static pbd::MessageDescriptor Descriptor { public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage1__Descriptor; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage1__Descriptor; }
} }
protected override pb::FieldAccess.FieldAccessorTable<SpeedMessage1, SpeedMessage1.Builder> InternalFieldAccessors { protected override pb::FieldAccess.FieldAccessorTable<SpeedMessage1, SpeedMessage1.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage1__FieldAccessorTable; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage1__FieldAccessorTable; }
} }
private bool hasField1; private bool hasField1;
...@@ -439,11 +439,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -439,11 +439,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
private bool hasField15; private bool hasField15;
private global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2 field15_ = global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2.DefaultInstance; private global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2 field15_ = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.DefaultInstance;
public bool HasField15 { public bool HasField15 {
get { return hasField15; } get { return hasField15; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2 Field15 { public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2 Field15 {
get { return field15_; } get { return field15_; }
} }
...@@ -1042,7 +1042,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -1042,7 +1042,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
break; break;
} }
case 122: { case 122: {
global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2.Builder subBuilder = global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2.CreateBuilder(); global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Builder subBuilder = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.CreateBuilder();
if (HasField15) { if (HasField15) {
subBuilder.MergeFrom(Field15); subBuilder.MergeFrom(Field15);
} }
...@@ -1794,24 +1794,24 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -1794,24 +1794,24 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
public bool HasField15 { public bool HasField15 {
get { return result.HasField15; } get { return result.HasField15; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2 Field15 { public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2 Field15 {
get { return result.Field15; } get { return result.Field15; }
set { SetField15(value); } set { SetField15(value); }
} }
public Builder SetField15(global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2 value) { public Builder SetField15(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2 value) {
result.hasField15 = true; result.hasField15 = true;
result.field15_ = value; result.field15_ = value;
return this; return this;
} }
public Builder SetField15(global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2.Builder builderForValue) { public Builder SetField15(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Builder builderForValue) {
result.hasField15 = true; result.hasField15 = true;
result.field15_ = builderForValue.Build(); result.field15_ = builderForValue.Build();
return this; return this;
} }
public Builder MergeField15(global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2 value) { public Builder MergeField15(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2 value) {
if (result.HasField15 && if (result.HasField15 &&
result.field15_ != global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2.DefaultInstance) { result.field15_ != global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.DefaultInstance) {
result.field15_ = global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2.CreateBuilder(result.field15_).MergeFrom(value).BuildPartial(); result.field15_ = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.CreateBuilder(result.field15_).MergeFrom(value).BuildPartial();
} else { } else {
result.field15_ = value; result.field15_ = value;
} }
...@@ -1820,7 +1820,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -1820,7 +1820,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public Builder ClearField15() { public Builder ClearField15() {
result.hasField15 = false; result.hasField15 = false;
result.field15_ = global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage2.DefaultInstance; result.field15_ = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.DefaultInstance;
return this; return this;
} }
...@@ -1949,11 +1949,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -1949,11 +1949,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public static pbd::MessageDescriptor Descriptor { public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage2__Descriptor; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage2__Descriptor; }
} }
protected override pb::FieldAccess.FieldAccessorTable<SpeedMessage2, SpeedMessage2.Builder> InternalFieldAccessors { protected override pb::FieldAccess.FieldAccessorTable<SpeedMessage2, SpeedMessage2.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage2__FieldAccessorTable; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage2__FieldAccessorTable; }
} }
private bool hasField1; private bool hasField1;
...@@ -2901,11 +2901,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -2901,11 +2901,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public static pbd::MessageDescriptor Descriptor { public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage3__Descriptor; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage3__Descriptor; }
} }
protected override pb::FieldAccess.FieldAccessorTable<SpeedMessage3, SpeedMessage3.Builder> InternalFieldAccessors { protected override pb::FieldAccess.FieldAccessorTable<SpeedMessage3, SpeedMessage3.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage3__FieldAccessorTable; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage3__FieldAccessorTable; }
} }
#region Nested types #region Nested types
...@@ -2925,11 +2925,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -2925,11 +2925,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public static pbd::MessageDescriptor Descriptor { public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage3_Group1__Descriptor; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage3_Group1__Descriptor; }
} }
protected override pb::FieldAccess.FieldAccessorTable<Group1, Group1.Builder> InternalFieldAccessors { protected override pb::FieldAccess.FieldAccessorTable<Group1, Group1.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage3_Group1__FieldAccessorTable; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage3_Group1__FieldAccessorTable; }
} }
private bool hasField11; private bool hasField11;
...@@ -3074,11 +3074,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -3074,11 +3074,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
private bool hasField31; private bool hasField31;
private global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4 field31_ = global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4.DefaultInstance; private global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4 field31_ = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4.DefaultInstance;
public bool HasField31 { public bool HasField31 {
get { return hasField31; } get { return hasField31; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4 Field31 { public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4 Field31 {
get { return field31_; } get { return field31_; }
} }
...@@ -3411,7 +3411,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -3411,7 +3411,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
break; break;
} }
case 250: { case 250: {
global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4.Builder subBuilder = global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4.CreateBuilder(); global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4.Builder subBuilder = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4.CreateBuilder();
if (HasField31) { if (HasField31) {
subBuilder.MergeFrom(Field31); subBuilder.MergeFrom(Field31);
} }
...@@ -3725,24 +3725,24 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -3725,24 +3725,24 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
public bool HasField31 { public bool HasField31 {
get { return result.HasField31; } get { return result.HasField31; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4 Field31 { public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4 Field31 {
get { return result.Field31; } get { return result.Field31; }
set { SetField31(value); } set { SetField31(value); }
} }
public Builder SetField31(global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4 value) { public Builder SetField31(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4 value) {
result.hasField31 = true; result.hasField31 = true;
result.field31_ = value; result.field31_ = value;
return this; return this;
} }
public Builder SetField31(global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4.Builder builderForValue) { public Builder SetField31(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4.Builder builderForValue) {
result.hasField31 = true; result.hasField31 = true;
result.field31_ = builderForValue.Build(); result.field31_ = builderForValue.Build();
return this; return this;
} }
public Builder MergeField31(global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4 value) { public Builder MergeField31(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4 value) {
if (result.HasField31 && if (result.HasField31 &&
result.field31_ != global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4.DefaultInstance) { result.field31_ != global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4.DefaultInstance) {
result.field31_ = global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4.CreateBuilder(result.field31_).MergeFrom(value).BuildPartial(); result.field31_ = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4.CreateBuilder(result.field31_).MergeFrom(value).BuildPartial();
} else { } else {
result.field31_ = value; result.field31_ = value;
} }
...@@ -3751,7 +3751,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -3751,7 +3751,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public Builder ClearField31() { public Builder ClearField31() {
result.hasField31 = false; result.hasField31 = false;
result.field31_ = global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage4.DefaultInstance; result.field31_ = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage4.DefaultInstance;
return this; return this;
} }
} }
...@@ -3958,14 +3958,14 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -3958,14 +3958,14 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
get { return field63_; } get { return field63_; }
} }
private pbc::PopsicleList<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1> group1_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1>(); private pbc::PopsicleList<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1> group1_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1>();
public scg::IList<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1> Group1List { public scg::IList<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1> Group1List {
get { return group1_; } get { return group1_; }
} }
public int Group1Count { public int Group1Count {
get { return group1_.Count; } get { return group1_.Count; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1 GetGroup1(int index) { public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1 GetGroup1(int index) {
return group1_[index]; return group1_[index];
} }
...@@ -4060,7 +4060,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -4060,7 +4060,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
if (HasField6) { if (HasField6) {
output.WriteString(6, Field6); output.WriteString(6, Field6);
} }
foreach (global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1 element in Group1List) { foreach (global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1 element in Group1List) {
output.WriteGroup(10, element); output.WriteGroup(10, element);
} }
if (HasField21) { if (HasField21) {
...@@ -4211,7 +4211,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -4211,7 +4211,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
if (HasField63) { if (HasField63) {
size += pb::CodedOutputStream.ComputeInt32Size(63, Field63); size += pb::CodedOutputStream.ComputeInt32Size(63, Field63);
} }
foreach (global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1 element in Group1List) { foreach (global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1 element in Group1List) {
size += pb::CodedOutputStream.ComputeGroupSize(10, element); size += pb::CodedOutputStream.ComputeGroupSize(10, element);
} }
foreach (string element in Field128List) { foreach (string element in Field128List) {
...@@ -4456,7 +4456,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -4456,7 +4456,7 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
break; break;
} }
case 83: { case 83: {
global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1.Builder subBuilder = global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1.CreateBuilder(); global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1.Builder subBuilder = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1.CreateBuilder();
input.ReadGroup(10, subBuilder, extensionRegistry); input.ReadGroup(10, subBuilder, extensionRegistry);
AddGroup1(subBuilder.BuildPartial()); AddGroup1(subBuilder.BuildPartial());
break; break;
...@@ -4958,32 +4958,32 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -4958,32 +4958,32 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
return this; return this;
} }
public scg::IList<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1> Group1List { public scg::IList<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1> Group1List {
get { return result.group1_; } get { return result.group1_; }
} }
public int Group1Count { public int Group1Count {
get { return result.Group1Count; } get { return result.Group1Count; }
} }
public global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1 GetGroup1(int index) { public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1 GetGroup1(int index) {
return result.GetGroup1(index); return result.GetGroup1(index);
} }
public Builder SetGroup1(int index, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1 value) { public Builder SetGroup1(int index, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1 value) {
result.group1_[index] = value; result.group1_[index] = value;
return this; return this;
} }
public Builder SetGroup1(int index, global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1.Builder builderForValue) { public Builder SetGroup1(int index, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1.Builder builderForValue) {
result.group1_[index] = builderForValue.Build(); result.group1_[index] = builderForValue.Build();
return this; return this;
} }
public Builder AddGroup1(global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1 value) { public Builder AddGroup1(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1 value) {
result.group1_.Add(value); result.group1_.Add(value);
return this; return this;
} }
public Builder AddGroup1(global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1.Builder builderForValue) { public Builder AddGroup1(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1.Builder builderForValue) {
result.group1_.Add(builderForValue.Build()); result.group1_.Add(builderForValue.Build());
return this; return this;
} }
public Builder AddRangeGroup1(scg::IEnumerable<global::Google.ProtocolBuffers.BenchmarkProtos.SpeedMessage3.Types.Group1> values) { public Builder AddRangeGroup1(scg::IEnumerable<global::Google.ProtocolBuffers.ProtoBench.SpeedMessage3.Types.Group1> values) {
base.AddRange(values, result.group1_); base.AddRange(values, result.group1_);
return this; return this;
} }
...@@ -5159,11 +5159,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos { ...@@ -5159,11 +5159,11 @@ namespace Google.ProtocolBuffers.BenchmarkProtos {
} }
public static pbd::MessageDescriptor Descriptor { public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage4__Descriptor; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage4__Descriptor; }
} }
protected override pb::FieldAccess.FieldAccessorTable<SpeedMessage4, SpeedMessage4.Builder> InternalFieldAccessors { protected override pb::FieldAccess.FieldAccessorTable<SpeedMessage4, SpeedMessage4.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.BenchmarkProtos.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage4__FieldAccessorTable; } get { return global::Google.ProtocolBuffers.ProtoBench.BenchmarkSpeedProtoFile.internal__static_proto2_benchmark_v2_api_SpeedMessage4__FieldAccessorTable; }
} }
private bool hasField1; private bool hasField1;
......
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using Google.ProtocolBuffers;
namespace ProtoBench { namespace Google.ProtocolBuffers.ProtoBench
{
/// <summary> /// <summary>
/// Simple benchmarking of arbitrary messages. /// Simple benchmarking of arbitrary messages.
/// </summary> /// </summary>
...@@ -52,21 +52,22 @@ namespace ProtoBench { ...@@ -52,21 +52,22 @@ namespace ProtoBench {
Benchmark("Serialize to byte string", inputData.Length, () => sampleMessage.ToByteString()); Benchmark("Serialize to byte string", inputData.Length, () => sampleMessage.ToByteString());
Benchmark("Serialize to byte array", inputData.Length, () => sampleMessage.ToByteArray()); Benchmark("Serialize to byte array", inputData.Length, () => sampleMessage.ToByteArray());
Benchmark("Serialize to memory stream", inputData.Length, () => sampleMessage.WriteTo(new MemoryStream())); Benchmark("Serialize to memory stream", inputData.Length, () => sampleMessage.WriteTo(new MemoryStream()));
Benchmark("Deserialize from byte string", inputData.Length, () => Benchmark("Deserialize from byte string", inputData.Length,
defaultMessage.WeakCreateBuilderForType() () => defaultMessage.WeakCreateBuilderForType()
.WeakMergeFrom(inputString) .WeakMergeFrom(inputString)
.WeakBuild() .WeakBuild()
); );
Benchmark("Deserialize from byte array", inputData.Length, () => Benchmark("Deserialize from byte array", inputData.Length,
defaultMessage.WeakCreateBuilderForType() () => defaultMessage.WeakCreateBuilderForType()
.WeakMergeFrom(CodedInputStream.CreateInstance(inputData)) .WeakMergeFrom(CodedInputStream.CreateInstance(inputData))
.WeakBuild() .WeakBuild()
); );
Benchmark("Deserialize from memory stream", inputData.Length, () => Benchmark("Deserialize from memory stream", inputData.Length, () => {
inputStream.Position = 0;
defaultMessage.WeakCreateBuilderForType() defaultMessage.WeakCreateBuilderForType()
.WeakMergeFrom(CodedInputStream.CreateInstance(inputStream)) .WeakMergeFrom(CodedInputStream.CreateInstance(inputStream))
.WeakBuild() .WeakBuild();
); });
return true; return true;
} catch (Exception e) { } catch (Exception e) {
Console.Error.WriteLine("Error: {0}", e.Message); Console.Error.WriteLine("Error: {0}", e.Message);
...@@ -92,8 +93,8 @@ namespace ProtoBench { ...@@ -92,8 +93,8 @@ namespace ProtoBench {
iterations = (int) ((TargetTime.Ticks / (double)elapsed.Ticks) * iterations); iterations = (int) ((TargetTime.Ticks / (double)elapsed.Ticks) * iterations);
elapsed = TimeAction(action, iterations); elapsed = TimeAction(action, iterations);
Console.WriteLine("{0}: {1} iterations in {2:f3}s; {3:f3}MB/s", Console.WriteLine("{0}: {1} iterations in {2:f3}s; {3:f3}MB/s",
name, iterations, elapsed.TotalSeconds, name, iterations, elapsed.TotalSeconds,
(iterations * dataSize) / (elapsed.TotalSeconds * 1024 * 1024)); (iterations * dataSize) / (elapsed.TotalSeconds * 1024 * 1024));
} }
private static TimeSpan TimeAction(Action action, int iterations) { private static TimeSpan TimeAction(Action action, int iterations) {
...@@ -105,4 +106,4 @@ namespace ProtoBench { ...@@ -105,4 +106,4 @@ namespace ProtoBench {
return sw.Elapsed; return sw.Elapsed;
} }
} }
} }
\ No newline at end of file
using System; using System;
using System.IO; using System.IO;
using System.Reflection;
using Google.ProtocolBuffers;
namespace ProtoDump { namespace Google.ProtocolBuffers.ProtoDump
{
/// <summary> /// <summary>
/// Small utility to load a binary message and dump it in text form /// Small utility to load a binary message and dump it in text form
/// </summary> /// </summary>
...@@ -40,4 +39,4 @@ namespace ProtoDump { ...@@ -40,4 +39,4 @@ namespace ProtoDump {
} }
} }
} }
} }
\ No newline at end of file
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers.ProtoMunge namespace Google.ProtocolBuffers.ProtoMunge
...@@ -143,7 +142,7 @@ namespace Google.ProtocolBuffers.ProtoMunge ...@@ -143,7 +142,7 @@ namespace Google.ProtocolBuffers.ProtoMunge
return BitConverter.ToInt32(data, 0); return BitConverter.ToInt32(data, 0);
} }
case FieldType.Enum: case FieldType.Enum:
return MungeEnum(fieldDescriptor, (int) value); return MungeEnum(fieldDescriptor, (EnumValueDescriptor) value);
default: default:
// TODO(jonskeet): Different exception? // TODO(jonskeet): Different exception?
throw new ArgumentException("Invalid field descriptor"); throw new ArgumentException("Invalid field descriptor");
...@@ -207,16 +206,16 @@ namespace Google.ProtocolBuffers.ProtoMunge ...@@ -207,16 +206,16 @@ namespace Google.ProtocolBuffers.ProtoMunge
return min + (ulong)(range * rng.NextDouble()); return min + (ulong)(range * rng.NextDouble());
} }
private static object MungeEnum(FieldDescriptor fieldDescriptor, int original) { private static object MungeEnum(FieldDescriptor fieldDescriptor, EnumValueDescriptor original) {
// Find all the values which get encoded to the same size as the current value, and pick one at random // Find all the values which get encoded to the same size as the current value, and pick one at random
int originalSize = CodedOutputStream.ComputeRawVarint32Size((uint)original); int originalSize = CodedOutputStream.ComputeRawVarint32Size((uint)original.Number);
List<EnumValueDescriptor> sameSizeValues = new List<EnumValueDescriptor> (); List<EnumValueDescriptor> sameSizeValues = new List<EnumValueDescriptor> ();
foreach (EnumValueDescriptor candidate in fieldDescriptor.EnumType.Values) { foreach (EnumValueDescriptor candidate in fieldDescriptor.EnumType.Values) {
if (CodedOutputStream.ComputeRawVarint32Size((uint)candidate.Number) == originalSize) { if (CodedOutputStream.ComputeRawVarint32Size((uint)candidate.Number) == originalSize) {
sameSizeValues.Add(candidate); sameSizeValues.Add(candidate);
} }
} }
return sameSizeValues[rng.Next(sameSizeValues.Count)].Number; return sameSizeValues[rng.Next(sameSizeValues.Count)];
} }
private static object MungeByteString(ByteString byteString) { private static object MungeByteString(ByteString byteString) {
......
...@@ -88,8 +88,9 @@ namespace Google.ProtocolBuffers { ...@@ -88,8 +88,9 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Gets an element of a repeated field. For value type fields /// Gets an element of a repeated field. For value type fields
/// including enums, the boxed value is returned. For embedded /// excluding enums, the boxed value is returned. For embedded
/// message fields, the sub-message is returned. /// message fields, the sub-message is returned. For enums, the
/// relevant EnumValueDescriptor is returned.
/// </summary> /// </summary>
/// <exception cref="ArgumentException">the field is not a repeated field, /// <exception cref="ArgumentException">the field is not a repeated field,
/// or it's not a field of this type</exception> /// or it's not a field of this type</exception>
......
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