Quote:
Originally Posted by Greg McKaskle
I haven't used Pascal in a long time, but seem to remember it storing 2D arrays with different elements adjacent. It was column-major and C was row-major. The notation isn't important, but accessing adjacent elements in the cache will be far faster than jumping by 20Kb to pickup up the next element.
|
I was thinking the extra computation required for this might be the culprit:
Code:
#define ELEMENT(M, i,j) (M[(i)*((i)+1)/2+(j)])