비교 - Count() > 0, Any(), Count > 0
Count() > 0 on a List with 1,000,000 elements
Any() on the same list
Count > 0 using the property
결과
| Method | Mean | Allocated |
|----------------|-----------|-----------|
| CountMethod | 20.521 us | 0 B |
| AnyMethod | 0.989 us | 0 B |
| PropertyAccess | 0.045 us | 0 B |
글 : Boost Your C# Code: Why Any() is Faster Than Count() > 0 for Performance
저자 : Sukhpinder Singh