3 ms·
Additionally, if you do the wait for a byte, you've done 90% of the wait for 63 adjacent bytes. Software becomes memory bound when it peeks at 4 bytes here, 4
by corysama 8y ago
Additionally, if you do the wait for a byte, you've done 90% of the wait for 63 adjacent bytes. Software becomes memory bound when it peeks at 4 bytes here, 4 bytes there in zillions of unpredictable cache lines. So, instead of waiting 41 cycles to process 64 bytes, it waits 300 cycles to process 4.
It helps to think of the * and -> operators in C++ as "int cache64BytesAndLoad4FromCache(int *p);" That's when you start to really feel "int x = a->b->c->d; a = a->next;" deep in your gut.