So today while messing around in Unity I ran into something that I thought was strange. I have some code that generates a list of ~40k vector3 points along with some other things that is blazing fast. I know its fast because when I just have it print the size of the list to the console it happens almost immediately after I hit the play button. Now when I loop through the entire list and have it print out each Vector3, it takes much longer.
My loop is set up as such…
foreach (var vert in verticesList)
{
print("Vertex " + ind + ": " + vert.x * 105 + "," + vert.y * 105+ "," + vert.z * 105);
ind++;
}
Any advice on why this increase run time by so much would be very much appreciated.