How can I get my results faster?
Optimising memory use
- Cache and TLB misses are very expensive
- Aim to reuse data as much as possible while still in the cache
- Use data following last item referenced — allows faster access
- e.g. next item in a 1D array
- consider: is data stored column or row wise in 2D arrays?
- Use libraries which are tuned to the specific processor memory, e.g. blas
- Use compiler optimisations — compiler modifies code to make better use of caches
- Rewrite programs for efficient memory access?
- Compiler optimisation is easier and may give the best (or good enough) results