Performant extensions for List<T>
MIT. You are free to use, modify, and distribute the project without any charge.
The project contains different useful methods that would help develop your logic without making duplications.
All developed methods are well-tested, allocation free and utilizes most performant features (like SIMD operations and ReadOnlySpan<T>)
Our team selected the following pipeline for creating reliable extensions:
- Method analysis (arguments, algorithms, edge cases)
- Writing test implementations
- Benchmarking performance with Benchmark .NET
- Results analysis and creating final implementations
- Writing unit tests
- ListBasicExtensions (Pop, PopFirst, TryFind and e.t.c ) - simple extension methods
- ListRangeExtensions (ForEachOnRange, AggregateOnRange, MaxIndexOnRange and e.t.c ) - extensions for performant operations with range support
- ListNoNanExtensions (MaxIndexOnRangeSIMD, MaxRangeSIMD and e.t.c) - blazingly fast extensions for floating point types
- TODO: ListSelectExtensions
- TODO: ListSelectConvertExtensions
List<int> list = new List<int> { 1, 2, 3, 4, 5, 6 };
int value = list.Pop(); // Removes and returns last element - 6, now the list is 1, 2, 3, 4, 5
if (!list.TryFind(x => x > 2, out int result)) // Method will find 3 and result will be equal to 3
{
return;
}
int biggest = list.MaxIndexOnRange(2); // Will find index of the biggest element, it will be 2TODO: Create proper documentation
TODO: Present the results