Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimise memory allocations in HtmlRender.
This is mainly done by avoiding creating additional `StringBuilder`s and writing direct to the `TextWriter` where possible. Where `StringBuilder`s are still needed, they're pooled and reused Saves on the amount of allocated memory and time paused for GC. ## Before > - CommandLine: "s:\ReportGenerator\src\Playground\bin\Debug\net8.0\Playground.exe" > - Runtime Version: V 8.0.824.36612 > - CLR Startup Flags: 8388611 > - Total CPU Time: 38,443 msec > - Total GC CPU Time: 1,666 msec > - Total Allocs : 8,378.712 MB > - Number of Heaps: 1 > - GC CPU MSec/MB Alloc : 0.199 MSec/MB > - Total GC Pause: 2,567.9 msec > - % Time paused for Garbage Collection: 8.1% > - % CPU Time spent Garbage Collecting: 4.3% > - Max GC Heap Size: 335.820 MB > - Peak Process Working Set: 395.698 MB > - Peak Virtual Memory Usage: 2,480,960.369 MB ## After > - CommandLine: "s:\ReportGenerator\src\Playground\bin\Debug\net8.0\Playground.exe" > - Runtime Version: V 8.0.824.36612 > - CLR Startup Flags: 8388611 > - Total CPU Time: 28,247 msec > - Total GC CPU Time: 1,183 msec > - Total Allocs : 2,938.748 MB > - Number of Heaps: 1 > - GC CPU MSec/MB Alloc : 0.403 MSec/MB > - Total GC Pause: 1,348.8 msec > - % Time paused for Garbage Collection: 6.2% > - % CPU Time spent Garbage Collecting: 4.2% > - Max GC Heap Size: 352.258 MB > - Peak Process Working Set: 417.976 MB > - Peak Virtual Memory Usage: 2,480,959.902 MB
- Loading branch information