Identical GetSimpleTypeName implementations live in two places:
TUnit.Core/DataSources/TestDataFormatter.cs:105-128
TUnit.Engine/Helpers/DisplayNameBuilder.cs:115-138
Both recursively allocate new string[genericArgs.Length] then string.Join(", ", ...) per generic parameter, then interpolate into $"{name}<{args}>".
Suggested fix: extract a single helper that uses a pooled StringBuilder for the entire recursive build (one allocation for the final string, not one per level).
Why hot: Every parameterized generic test display name.
TFM: No gating needed.
Related: #6028.
Identical
GetSimpleTypeNameimplementations live in two places:TUnit.Core/DataSources/TestDataFormatter.cs:105-128TUnit.Engine/Helpers/DisplayNameBuilder.cs:115-138Both recursively allocate
new string[genericArgs.Length]thenstring.Join(", ", ...)per generic parameter, then interpolate into$"{name}<{args}>".Suggested fix: extract a single helper that uses a pooled
StringBuilderfor the entire recursive build (one allocation for the final string, not one per level).Why hot: Every parameterized generic test display name.
TFM: No gating needed.
Related: #6028.