3 ms·
A fun exercise is to see how bad you can get effective bandwidth to be in the minimal amount of code. Read a byte, use it to feed FNV-1a, use that to look up a
by corysama 5y ago
A fun exercise is to see how bad you can get effective bandwidth to be in the minimal amount of code.
Read a byte, use it to feed FNV-1a, use that to look up another byte in a fixed-size array. The number of bytes per second you end up reading ends up comedically low.
- mhh__ 5y agoWhen profiling a certain compiler I found a O(n^2) algorithm which literally did almost exactly what you said. 1 cacheline accessed for every 3 iterations due to some enormous structs, whose members index other arrays etc. Etc. It turned out 87% of all straight-to-DRAM accesses happened on one line.