Suppose a1, b1, c1, and d1 point to heap memory and my numerical code has the following core loop. const int n=100000 for(int j=0;j<n;j++){ a1[j] += b1[j]; c1[j] += d1[j]; […]

Continue Reading
Skip to content
# Tag: so

## C++: Why is one loop so much slower than two loops?

Posted on by TFE Times

Suppose a1, b1, c1, and d1 point to heap memory and my numerical code has the following core loop. const int n=100000 for(int j=0;j<n;j++){ a1[j] += b1[j]; c1[j] += d1[j]; […]

Continue Reading