diff options
author | csharptest <roger@csharptest.net> | 2011-06-09 19:47:56 -0500 |
---|---|---|
committer | rogerk <devnull@localhost> | 2011-06-09 19:47:56 -0500 |
commit | ced18e10ae9ca41f338c9e788642d705dd17f9d4 (patch) | |
tree | 334ca02758aca596df2b71fb4ada50db71aa4913 /src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs | |
parent | 367e02261c6bee9bce37cb6942bd6cbf743fb67c (diff) | |
download | protobuf-ced18e10ae9ca41f338c9e788642d705dd17f9d4.tar.gz protobuf-ced18e10ae9ca41f338c9e788642d705dd17f9d4.tar.bz2 protobuf-ced18e10ae9ca41f338c9e788642d705dd17f9d4.zip |
Several performance tweaks
- Removed default value assingment when default is equal to default(T)
- Added Benchmarks for most types and repeated/packed arrays
- Left PopsicleList's list fields uninitialized util needed
- Changed CodedInputStream's repated/packed reader
- Changed Enum writers to simply cast to int
- Changed the WriteEnum to use object rawValue that provides .ToString() if needed
- Should be fully on par with original library for performance, gaining 2x-3x in some cases
Diffstat (limited to 'src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs')
-rw-r--r-- | src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs b/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs index 8bcbde7f..e3308065 100644 --- a/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs +++ b/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs @@ -178,7 +178,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos { public const int MultipleFilesFieldNumber = 4;
private bool hasMultipleFiles;
- private bool multipleFiles_ = false;
+ private bool multipleFiles_;
public bool HasMultipleFiles {
get { return hasMultipleFiles; }
}
@@ -188,7 +188,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos { public const int NestClassesFieldNumber = 5;
private bool hasNestClasses;
- private bool nestClasses_ = false;
+ private bool nestClasses_;
public bool HasNestClasses {
get { return hasNestClasses; }
}
@@ -198,7 +198,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos { public const int CodeContractsFieldNumber = 6;
private bool hasCodeContracts;
- private bool codeContracts_ = false;
+ private bool codeContracts_;
public bool HasCodeContracts {
get { return hasCodeContracts; }
}
@@ -208,7 +208,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos { public const int ExpandNamespaceDirectoriesFieldNumber = 7;
private bool hasExpandNamespaceDirectories;
- private bool expandNamespaceDirectories_ = false;
+ private bool expandNamespaceDirectories_;
public bool HasExpandNamespaceDirectories {
get { return hasExpandNamespaceDirectories; }
}
@@ -258,7 +258,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos { public const int IgnoreGoogleProtobufFieldNumber = 224;
private bool hasIgnoreGoogleProtobuf;
- private bool ignoreGoogleProtobuf_ = false;
+ private bool ignoreGoogleProtobuf_;
public bool HasIgnoreGoogleProtobuf {
get { return hasIgnoreGoogleProtobuf; }
}
@@ -322,7 +322,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos { output.WriteBool(224, field_names[4], IgnoreGoogleProtobuf);
}
if (hasServiceGeneratorType) {
- output.WriteEnum(225, field_names[10], (int) ServiceGeneratorType, ServiceGeneratorType.ToString());
+ output.WriteEnum(225, field_names[10], (int) ServiceGeneratorType, ServiceGeneratorType);
}
UnknownFields.WriteTo(output);
}
@@ -1372,7 +1372,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos { public const int DispatchIdFieldNumber = 1;
private bool hasDispatchId;
- private int dispatchId_ = 0;
+ private int dispatchId_;
public bool HasDispatchId {
get { return hasDispatchId; }
}
|