Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
901cc5e
perf: optimize some repeated enumerations
thomhurst Oct 28, 2025
a8754b8
perf: enhance performance by caching results and reducing reflection …
thomhurst Oct 28, 2025
6927f55
Refactor test metadata generation to use static lambdas and support V…
thomhurst Oct 29, 2025
d7b68e7
refactor: optimize argument formatting in TestContext and improve tim…
thomhurst Oct 29, 2025
d7e7d3d
refactor: streamline argument formatting in ArgumentFormatter and opt…
thomhurst Oct 29, 2025
372de24
refactor: replace Array.Empty with array literals for improved readab…
thomhurst Oct 29, 2025
e132c13
refactor: replace Enumerable.Empty with array literal for improved pe…
thomhurst Oct 29, 2025
8bbb4ea
refactor: use static lambdas in GetReferencedAssemblies and GetInterf…
thomhurst Oct 29, 2025
3783332
refactor: use static lambdas in TestMetadataGenerator, AsyncConvert, …
thomhurst Oct 29, 2025
308611e
Refactor AttributeFactory to use static lambda expressions in test so…
thomhurst Oct 29, 2025
7c0b563
refactor: simplify counter increment logic in EventReceiverOrchestrat…
thomhurst Oct 29, 2025
368eeb6
refactor: update classData handling to fetch fresh data for each test…
thomhurst Oct 29, 2025
9eee0e9
refactor: streamline class data fetching to avoid redundant calls in …
thomhurst Oct 29, 2025
b5009b6
Add exception handling to test invocations and metadata generation
thomhurst Oct 29, 2025
5fbf6a5
refactor: introduce HashSetPool for efficient HashSet management duri…
thomhurst Oct 29, 2025
f0a4e54
refactor: extract RepeatCount from attributes to improve test metadat…
thomhurst Oct 29, 2025
505cb28
refactor: remove RepeatAttribute from DynamicTest attributes for clea…
thomhurst Oct 29, 2025
bf9515b
refactor: remove --fail-fast argument to allow all tests to run even …
thomhurst Oct 29, 2025
c6c7b15
refactor: invalidate cached eligible event objects when ClassInstance…
thomhurst Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: use static lambdas in GetReferencedAssemblies and GetInterf…
…aces for improved performance
  • Loading branch information
thomhurst committed Oct 29, 2025
commit 8bbb4eadb4742619b8cf5c79f95a8f68f5b3cadb
2 changes: 1 addition & 1 deletion TUnit.Core/Data/ThreadSafeDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ThreadSafeDictionary<TKey,

public ICollection<TKey> Keys => _innerDictionary.Keys;

public IEnumerable<TValue> Values => _innerDictionary.Values.Select(lazy => lazy.Value);
public IEnumerable<TValue> Values => _innerDictionary.Values.Select(static lazy => lazy.Value);

public TValue GetOrAdd(TKey key, Func<TKey, TValue> func)
{
Expand Down
4 changes: 2 additions & 2 deletions TUnit.Engine/Helpers/AssemblyReferenceCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ internal static class AssemblyReferenceCache
#endif
public static AssemblyName[] GetReferencedAssemblies(Assembly assembly)
{
return _assemblyCache.GetOrAdd(assembly, a => a.GetReferencedAssemblies());
return _assemblyCache.GetOrAdd(assembly, static a => a.GetReferencedAssemblies());
}

#if NET6_0_OR_GREATER
[UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "Type.GetInterfaces is reflection-based but safe for type checking")]
#endif
public static Type[] GetInterfaces(Type type)
{
return _interfaceCache.GetOrAdd(type, t => t.GetInterfaces());
return _interfaceCache.GetOrAdd(type, static t => t.GetInterfaces());
}
}
Loading