Commit 75f4268e authored by Jon Skeet's avatar Jon Skeet

Minor benchmarking changes

parent 6678a73b
...@@ -67,6 +67,7 @@ namespace Google.ProtocolBuffers.ProtoBench ...@@ -67,6 +67,7 @@ namespace Google.ProtocolBuffers.ProtoBench
.WeakMergeFrom(CodedInputStream.CreateInstance(inputStream)) .WeakMergeFrom(CodedInputStream.CreateInstance(inputStream))
.WeakBuild(); .WeakBuild();
}); });
Console.WriteLine();
return true; return true;
} catch (Exception e) { } catch (Exception e) {
Console.Error.WriteLine("Error: {0}", e.Message); Console.Error.WriteLine("Error: {0}", e.Message);
...@@ -97,6 +98,8 @@ namespace Google.ProtocolBuffers.ProtoBench ...@@ -97,6 +98,8 @@ namespace Google.ProtocolBuffers.ProtoBench
} }
private static TimeSpan TimeAction(Action action, int iterations) { private static TimeSpan TimeAction(Action action, int iterations) {
GC.Collect();
GC.WaitForPendingFinalizers();
Stopwatch sw = Stopwatch.StartNew(); Stopwatch sw = Stopwatch.StartNew();
for (int i = 0; i < iterations; i++) { for (int i = 0; i < iterations; i++) {
action(); action();
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BenchmarkProtoFile.cs" />
<Compile Include="BenchmarkSpeedProtoFile.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </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