Any performance difficulties related to List? I'm using the following structure:

class Map
{
    public List&lt;List&lt;Point&gt;&gt; points;
    public List&lt;Base&gt; bases;
}


Point and Base are over-normal sized classes (has more than 30 attributes).

And I'm iterating this Map class like this:

public static void calculateMatrix(Map map) 
{
    LineOfSight.LineOfSight los = new LineOfSight.LineOfSight();

    foreach (var b in map.bases)
    {
        foreach (var cc in map.points) 
        {
            foreach (var c in cc)
            {
                calculatePointValues(c, b, los);
            }
        }
    }
}


There is around 500*500 points List&lt;List&lt;T&gt;&gt; and around 10 bases.

This iterating is calling calculatePointValues method around 2.5 million.

And my application can be initiated around 30 seconds.

Shall I use Array instead of List&lt;&gt;?
Shall I use for() instead of foreach?

Or, what should I do?
As was said in the comments, I don't think List&lt;T&gt; makes any significant difference over an array.

But with a bit of LINQ you can reduce the nesting a bit:

foreach (var b in map.bases)
{
    foreach (var c in map.points.SelectMany(cc =&gt; cc))
    {
        CalculatePointValues(c, b, los);
    }
}


And it could be worth trying to profile it with some Parallel looping as well:

Parallel.ForEach(map.bases, b =&gt;
    {
        foreach (var c in map.points.SelectMany(cc =&gt; cc))
        {
            CalculatePointValues(c, b, los);
        }
    });