Improving performance of R2RDump
authorAndrew Au <andrewau@microsoft.com>
Tue, 17 Dec 2019 17:38:43 +0000 (09:38 -0800)
committerAndrew Au <andrewau@microsoft.com>
Tue, 17 Dec 2019 17:38:48 +0000 (09:38 -0800)
src/coreclr/src/tools/r2rdump/R2RDump.cs
src/coreclr/src/tools/r2rdump/TextDumper.cs

index b0b3119..4979691 100644 (file)
@@ -93,7 +93,7 @@ namespace R2RDump
     public abstract class Dumper
     {
         protected readonly R2RReader _r2r;
-        protected readonly TextWriter _writer;
+        protected TextWriter _writer;
         protected readonly Disassembler _disassembler;
         protected readonly DumpOptions _options;
 
index 4203e58..ee5bac9 100644 (file)
@@ -120,7 +120,11 @@ namespace R2RDump
             SkipLine();
             foreach (R2RMethod method in NormalizedMethods())
             {
+                TextWriter temp = _writer;
+                _writer = new StringWriter();
                 DumpMethod(method);
+                temp.Write(_writer.ToString());
+                _writer = temp;
             }
         }