redundant allocations - #4185
#4185redundant allocations#4185thomhurst merged 2 commits intomainthomhurst/TUnit:mainfrom perf/redundant-allocationsthomhurst/TUnit:perf/redundant-allocationsCopy head branch name to clipboard
Conversation
…ing in data collectors
SummaryThis PR reduces redundant allocations in hot paths by caching parameter type arrays, attribute lookups, and assembly lists. Critical IssuesNone found ✅ Suggestions1. IsTrxEnabled static caching may be too aggressive (TestExtensions.cs:177-195)The new
Recommendation: Consider making this cache per- 2. Consider defensive null check in GetParameterTypes (MethodDataSourceAttribute.cs:269-281)The new Optional: Add a null check or document the invariant that 3. Field keyword usage for Assemblies property (ReflectionTestDataCollector.cs:36)The Just verify that:
Performance Impact AssessmentAll changes align with TUnit Rule 4: Performance First. The optimizations target hot paths: These are solid micro-optimizations. Great work! Verdict✅ APPROVE - No critical issues. Suggestions are optional improvements for consideration. |
No description provided.