According to the answers in this post, List<T>
is backed by an Array. According to this article, list iteration is considerably slower than array iteration.
If Lists are arrays 'under the hood', why do they take longer to iterate over, especially with foreach?
Note: This is assuming Lists are implemented with Arrays. I might have just interpreted the information wrong.
for
loop is still faster than reading lists (~4 to 5 times on my machine for an int array). However, in most real world situations, the difference is irrelevant. – Doc Brown May 11 '15 at 14:28