perf: use FrozenSet/FrozenDictionary for read-only static lookups by thomhurst · Pull Request #6099 · thomhurst/TUnit (original) (raw)
Convert three read-only static collections queried in hot per-test/per-assembly loops to FrozenSet/FrozenDictionary on net8+ for faster lookups:
- ObjectGraphDiscoverer.SkipTypes (HashSet)
- ReflectionTestDataCollector.ExcludedAssemblyNames (HashSet)
- TupleFactory.TypedFactories (Dictionary<Type, Func<...>>)
Frozen collections are net8+ only, so usage is guarded with #if NET8_0_OR_GREATER; netstandard2.0 retains the existing HashSet/Dictionary. All four TFMs build clean.
Closes #6047
[](/apps/claude)
thomhurst deleted the perf/issue-6047-frozen-collections 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 }})