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/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs
index 10900aa..e8f9dea 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs
@@ -74,7 +74,7 @@
public const int DFieldNumber = 1;
private bool hasD;
- private int d_ = 0;
+ private int d_;
public bool HasD {
get { return hasD; }
}
@@ -107,7 +107,7 @@
output.WriteInt32(1, field_names[0], D);
}
if (hasEn) {
- output.WriteEnum(2, field_names[1], (int) En, En.ToString());
+ output.WriteEnum(2, field_names[1], (int) En, En);
}
}
@@ -418,7 +418,7 @@
output.WriteString(1, field_names[0], Number);
}
if (hasType) {
- output.WriteEnum(2, field_names[1], (int) Type, Type.ToString());
+ output.WriteEnum(2, field_names[1], (int) Type, Type);
}
}
@@ -706,7 +706,7 @@
public const int ZipFieldNumber = 5;
private bool hasZip;
- private uint zip_ = 0;
+ private uint zip_;
public bool HasZip {
get { return hasZip; }
}
@@ -1077,7 +1077,7 @@
public const int IdFieldNumber = 2;
private bool hasId;
- private int id_ = 0;
+ private int id_;
public bool HasId {
get { return hasId; }
}