Whats the performance cost on iterating on a list multiple times
|Added at||2016-12-29 00:12|
I have a List I need to iterate through and perform work on along the way. My problem is that, for my program, its difficult to do all the work needed on the list every loop due to concurrency. My solution was to iterate over the loop as many times as necessary and doing part of the work in every iteration. This example should illustrate what I mean:
Method B is what I am curious about. Is there a notable cost to iterating over a loop multiple times? Since I assume most of the cost in performance will go to the "work" methods, I was wondering if it's fair to say the difference between Method A and Method B would be negligible?