I recently started thinking about optimization, now I know that there are many books and articles, but I have a specific scenario that interests me.
and.
for (i = 0; i < limit + 5; i++)
cout << test;
AT.
limit2 = limit +5;
for (i = 0; i < limit2; i++)
cout << test;
I want to know if the second piece of code will work faster, because it should only perform mathematical calculation once or is this calculation saved for the life time of the loop.
source
share