Browse Source

Use server GC for the decompiler test suite

The suite keeps one NUnit worker per logical CPU busy with allocation-heavy
decompiles (223 GB allocated per run), so under workstation GC every
gen0/gen1 collection any worker triggers suspends the whole process.
Measured on a 24-thread Windows box (Debug, ILSpy-tests checked out):
27,229 gen0 / 6,919 gen1 collections and 305 s of total GC pause in a
553 s run, at 45% average CPU. With server GC the same run takes 310 s,
1,251 gen0 / 492 gen1, 14 s of pause, 80% CPU, for the same ~46 min of
processor time; the in-suite roundtrip decompiles drop 2-3x
(Random_TestCase_1 353 s -> 133 s, ExplicitConversions 319 s -> 136 s,
NRefactory_CSharp 337 s -> 156 s). Standalone ilspycmd timings are
unaffected, which is what pointed at contention inside the test process
rather than decompiler cost.

Assisted-by: Claude:claude-fable-5:Claude Code
pull/4033/head
Christoph Wille 1 month ago
parent
commit
7f8d641501
  1. 6
      ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

6
ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

@ -18,6 +18,12 @@ @@ -18,6 +18,12 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<!-- The suite runs dozens of allocation-heavy decompiles concurrently (one NUnit worker per
logical CPU, each roundtrip adding WholeProjectDecompiler's own Parallel.ForEach). Workstation
GC stops the whole process for every gen0/gen1 collection any worker triggers; measured on a
24-thread machine that was ~300 s of pause in a ~550 s run. Server GC gives each core its own
heap and collects in parallel. -->
<ServerGarbageCollection>true</ServerGarbageCollection>
<!-- NU1902/1903 are "Package 'X' has a known security vulnerability". In our tests, we don't care. -->
<!-- CA1416 fires because the TFM dropped its -windows suffix: Windows-only helpers (SdkUtility,
Tester.SignAssembly/FindMSBuild/RunWithTestRunner) and Windows-only test inputs (Console.CapsLock

Loading…
Cancel
Save