Browse Source

Minor benchmarking changes

Jon Skeet 16 years ago
parent
commit
75f4268e60
2 changed files with 3 additions and 2 deletions
  1. 3 0
      src/ProtoBench/Program.cs
  2. 0 2
      src/ProtoBench/ProtoBench.csproj

+ 3 - 0
src/ProtoBench/Program.cs

@@ -67,6 +67,7 @@ namespace Google.ProtocolBuffers.ProtoBench
             .WeakMergeFrom(CodedInputStream.CreateInstance(inputStream))
             .WeakBuild();
         });
+        Console.WriteLine();
         return true;
       } catch (Exception e) {
         Console.Error.WriteLine("Error: {0}", e.Message);
@@ -97,6 +98,8 @@ namespace Google.ProtocolBuffers.ProtoBench
     }
 
     private static TimeSpan TimeAction(Action action, int iterations) {
+      GC.Collect();
+      GC.WaitForPendingFinalizers();
       Stopwatch sw = Stopwatch.StartNew();
       for (int i = 0; i < iterations; i++) {
         action();

+ 0 - 2
src/ProtoBench/ProtoBench.csproj

@@ -38,8 +38,6 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="BenchmarkProtoFile.cs" />
-    <Compile Include="BenchmarkSpeedProtoFile.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>