Two equality-style code paths allocate multiple LINQ iterators per comparison:
TUnit.Core/TestDependency.cs:146:
|| ! testParams . Select ( x => x . Type ) . SequenceEqual ( MethodParameters ! ) )
Select allocates iterator + lambda; SequenceEqual enumerates both. Replace with:
bool typesMatch ;
if ( testParams . Count != MethodParameters ! . Length ) typesMatch = false ;
else
{
typesMatch = true ;
for ( var i = 0 ; i < testParams . Count ; i ++ )
{
if ( testParams [ i ] . Type != MethodParameters [ i ] ) { typesMatch = false ; break ; }
}
}
TUnit.Core/Attributes/TestData/MethodDataSourceAttribute.cs:185:
& & x . GetParameters ( ) . Select ( p => p . ParameterType ) . SequenceEqual ( Arguments . Select ( a => a ? . GetType ( ) ) ) )
Two Selects + a SequenceEqual — three iterators per candidate method during data source resolution. Same loop refactor applies.
Why hot:
TestDependency.cs:146 — dependency equality check during graph build
MethodDataSourceAttribute.cs:185 — runs per candidate method per data source resolution call
TFM: No gating.
Reactions are currently unavailable
Two equality-style code paths allocate multiple LINQ iterators per comparison:
TUnit.Core/TestDependency.cs:146:Selectallocates iterator + lambda;SequenceEqualenumerates both. Replace with:TUnit.Core/Attributes/TestData/MethodDataSourceAttribute.cs:185:Two
Selects + aSequenceEqual— three iterators per candidate method during data source resolution. Same loop refactor applies.Why hot:
TestDependency.cs:146— dependency equality check during graph buildMethodDataSourceAttribute.cs:185— runs per candidate method per data source resolution callTFM: No gating.