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:
and later on, the programmer uses:Code:Uint64 Bits[64]; for (unsigned int i = 0; i != 64; ++i) { Bits[i] = 1LL << i; }
rather thanCode:Bits[bitnumber];
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?Code:1LL << bitnumber;
Thank you very much



LinkBack URL
About LinkBacks




CornedBee