4 ms·
Program size has a lot of interaction with performance, by way of your CPU's L2/L3 cache. If your program is too large, you get more cache misses when branchin
by nrclark 3y ago
Program size has a lot of interaction with performance, by way of your CPU's L2/L3 cache.
If your program is too large, you get more cache misses when branching around. Frequent cache misses have a _huge_ effect on your code's overall performance, and can completely negate any of the wins you get from loop unrolling or other optimizations.
This effect is very pronounced on small armv7l/aarch64 CPUs, which usually have much smaller caches than a desktop CPU. You can even see it on laptop CPUs too.
It's impossible to know where exactly your size cutoffs are, because they depend a lot on what else is running in your system (and CPU core allocation, etc). But they 100% exist, for any program on any system. If your whole program can fit into your CPU cache, you'll see a big performance difference vs having to fetch it from RAM all the time.