title: Conditions for loop unrolling to be beneficial and the point at which margins of return decrease?
body: <p>Could someone please explain firstly at what point does unrolling a loop (in C/C++) become a useful optimization to do? </p>
  
  <p>Secondly, linked to the first question, at what point should unrolling not be performed any further? Should the unrolling always be performed splitting operations into batches a power of 2? Or does it relate to how many calculations can be performed by your CPU? A ratio which is a multiplier of your cache line size? etc</p>
  
  <p>For example if I had a for-loop from 0 to 99 which would be better/how do I determine which (besides just trial and error)- is there a scientific method:</p>
  
  <ul>
  <li>0 to 49 and two "operations" per loop</li>
  <li>0 to 24 and four "operations" per loop</li>
  <li>0 to 19 and five "operations"  per loop</li>
  <li>0 to 9 and ten "operations" per loop</li>
  </ul>