The default equality constraints no longer need IEquatable<'tk> allowing usage of this library in more scenarios (e.g. tuple keys for hashMap)
The option is still there to define your own StandardEqualityTemplate<_> using IEquatable<_> for slightly better performance. Performance hit is round 6-13.1% (bigger collections -> smaller collections).
e.g. Using an equality comparer like below given the below Get statistics.
type [<Struct>] IntEqualityTemplate =
struct end
interface IEqualityComparer<int> with
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member __.Equals(x: int, y: int): bool = x = y
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member __.GetHashCode(obj: int): int = obj
The default equality constraints no longer need IEquatable<'tk> allowing usage of this library in more scenarios (e.g. tuple keys for hashMap)
The option is still there to define your own StandardEqualityTemplate<_> using IEquatable<_> for slightly better performance. Performance hit is round 6-13.1% (bigger collections -> smaller collections).
e.g. Using an equality comparer like below given the below Get statistics.