|
|
|
|
|
by enntwo
5879 days ago
|
|
One small caution when using LINQ, especially in performance critical areas (XNA for instance):
.Count and .Count() are dramatically difference in performance, when simply looking for the size of an array or list, be sure to use the .Count property as it is orders of magnitude faster. If you are using LINQ else where, .Count() will achieve the same behavior but will be much slower, so it can be a tough optimization to track down. |
|
Of course, calling the .Count property yourself is more efficient, but not by orders of magnitude.