perf(engine): hoist GetParameters and drop LINQ in reflection discovery by thomhurst · Pull Request #6063 · thomhurst/TUnit (original) (raw)
- Hoist ctor.GetParameters() out of the CreateReflectionInstanceFactory lambda.
- Hoist testMethod.GetParameters() out of CreateReflectionTestInvoker for the non-generic case (generic-method-definition path still resolves per call because methodToInvoke may differ per invocation).
- Replace types.Where(...) at the head of DiscoverTestsInAssembly and DiscoverTestsInAssemblyStreamingAsync with inline foreach + continue to avoid the WhereArrayIterator allocation per discovery pass.
- In the streaming path, drop the .Where(...) over methods and inline the TestAttribute/IsAbstract predicate into the existing foreach so testMethods stays as the raw MethodInfo[] with no LINQ enumerator wrapping it.
[](/apps/claude)
thomhurst deleted the perf/reflection-discovery-hot-path branch
This was referenced
May 29, 2026
This was referenced
Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})