SA
메인 내용으로 이동

Cache Conscious Programming

  • Arrays are row-major in C
  • Consider an arr[i][j] type of 2D array...
  • Then for (j=0;j<N;j++) for (i=0;i<M;i++) will be much slower than for (i=0;i<N;i++) for (j=0;j<M;j++) due to the way of caching
  • Metrics show that it can be up to 35x slower

이 문서를 언급한 문서들