4 ms·
Due to Fortran's memory model, its performance could potentially be drastically improved by altering the arrays such that the program is accessing consecutive c
by kenster07 13y ago
Due to Fortran's memory model, its performance could potentially be drastically improved by altering the arrays such that the program is accessing consecutive columns rather than rows.
from:
r = r + (X(i,k) - X(j,k)) * (X(i,k) - X(j,k))
to:
r = r + (X(k,i) - X(k,j)) * (X(k,i) - X(k,j))