I am currently working on a 2D-XNA game. It needs to be optimized because multi-user mode does not work well. In the code, we most often used foreach loops and did not use LINQ or returned return statements anywhere. I understand that we can win a certain performance here. Since it is faster for loops, I was thinking of replacing all foreach loops.
But, however, I cannot benefit from the return return statement in a for loop, can I?
Also, LINQ will still be useful when iterating using a for?
For example, I have a list of 1000 + shapes (squares, triangles, circles ...), and I want to list all the squares (75%) at a specific position. What is the best way to do this?
What should i use? Arrays, lists, for loops, foreach loops, return return and / or LINQ?
source share