osu-framework
osu-framework copied to clipboard
Consider deprecating HasFlagsFast() extension method
As of https://github.com/dotnet/runtime/pull/59514, the runtime implementation has been hoisted into the C# core library and no longer incurs allocation/performance overhead. It seems like this change is present in at least .NET 6.0.1
| Method | Mean | Error | StdDev | Allocated |
|------------ |----------:|----------:|----------:|----------:|
| HasFlag | 0.0232 ns | 0.0024 ns | 0.0023 ns | - |
| BitwiseAnd | 0.0115 ns | 0.0057 ns | 0.0050 ns | - |
| HasFlagFast | 0.0160 ns | 0.0023 ns | 0.0020 ns | - |