C# FindAll VS Where Speed

后端 未结 5 883
不思量自难忘°
不思量自难忘° 2020-12-05 22:49

Anyone know any speed differences between Where and FindAll on List. I know Where is part of IEnumerable and FindAll is part of List, I\'m just curious what\'s faster.

5条回答
  •  情深已故
    2020-12-05 23:13

    The answer from jrista makes senses. However, the new list adds the same objects, thus just growing with reference to existing objects, which should not be that slow. As long as 3.5 / Linq extension are possible, Where stays better anyway. FindAll makes much more sense when limited with 2.0

提交回复
热议问题