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
diff --git a/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs b/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
index 8bcbde7..e330806 100644
--- a/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
+++ b/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
@@ -178,7 +178,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
public const int DispatchIdFieldNumber = 1;
private bool hasDispatchId;
- private int dispatchId_ = 0;
+ private int dispatchId_;
public bool HasDispatchId {
get { return hasDispatchId; }
}