The optimization of EqualityComparerT and ComparerT instances for enum types may differ in different target frameworks.
- In .NET Framework 3.5 and earlier versions they are not optimized at all.
- In .NET 4.0 Framework EqualityComparerT was optimized for Int32-based enums. (Every .NET 4.0 assembly is executed on the latest 4.x runtime though, so this is might be relevant only on Windows XP where no newer than the 4.0 runtime can be installed.)
- In latest .NET 4.x Framework versions EqualityComparerT is optimized for any enum type but ComparerT is not.
- In .NET Core both EqualityComparerT and ComparerT are optimized for any enum types so the performance benefit of using in .NET Core is negligible.