how expensive are memory, L1, L2 accesses?
Hi,
I was wondering, how expensive (CPU cycles) are memory, L2 cache, L1 cache accesses on a modern x86 computer? I cannot seem to find an answer by googling. I am asking this because in some programs written by others, I am seeing something like:
Code:
Uint64 Bits[64];
for (unsigned int i = 0; i != 64; ++i) {
Bits[i] = 1LL << i;
}
and later on, the programmer uses:
rather than
Is this done purely for readability? Because I would assume that the memory load operation takes more cycles than the bitwise shift, since, if I remembered right, bitwise shifts are done in 1 cycle?
Thank you very much