I started reading Ulrich Drepper's excellent series What every
Programmer should know about memory
. It is published by
Linux Weekly News in weekly installments.
Until now, the following parts appeared:
- Commodity Hardware Today
- CPU Caches
- Virtual Memory
- NUMA Support
- What Programmers Can Do — Cache Optimization
- What Programmers Can Do — Multi-Threaded Optimizations
- Memory Performance Tools
- Future Technologies
- Appendices and Bibliography
The author shows, for example, how the naive matrix-matrix multiplication
for (i = 0; i < N; ++i) for (j = 0; j < N; ++j) for (k = 0; k < N; ++k) res[i][j] += A[i][k] * B[k][j];
can be improved to run 10 times faster for big matrices!