Optimized.Collections aims to provide drop in replacements for System.Collections with improved speed, memory or features in specific use cases.
By removing the ability to Remove or Clear collections the following advantages are possible:
- Improved performance and reduced memory.
- An improved threading model where reads are lock free.
- Set<T> and Map<K, V> are also IReadOnlyList<T> i.e. can be accessed by an index and passed as a list.
These can be particularly important in collection based logic and caches.
TODO
- Add struct Keys and Values to Map
- Expose VecLink<T>.
- SetSync<T> and MapSync<T>.
- Vec1<T>, Set1<T>, Map1<K, V> make a lot of sense and optimal for Set and Map as no Holder.Initial branch.
- Are SetLink<T> or MapLink<K, V> useful?
- Come back to Memo as a class
A set of high performance single and multi-threaded memoize functions for Func<T, R>, Func<Set<T>, R[]>, Func<IReadOnlyCollection<T>, R[]>, Func<Set<T>, Task<R[]>> and Func<IReadOnlyCollection<T>, Task<R[]>>.