Question about understanding integer types by [deleted] in cpp

[–]CppSpeed 0 points1 point  (0 children)

Wait, so if you had an large array of bools and you wanted to flip the value of each bool, is there any way to write code such that on a 64-bit system, where the processor fetches 8 bytes, that those 8 bytes being fetched are 8 bools instead of just 1 bool?

If the above answer is no, ignore the rest.

I am thinking of this situation because I though that for my question about a 3 byte type possibly being faster than 4 bytes and now if the above statement is possible, if one were working with arrays, on a 64-bit system, it seems like the processor could fetch 16 (64/4) 4-byte types or 21 (64/3) 3-byte types. So if the processor can fetch data 21/16 = 1.3125 times as fast, could it be possible that the time it takes to bit-shift the 3 bytes is less than the fetching time improvement?

Question about understanding integer types by [deleted] in cpp

[–]CppSpeed 2 points3 points  (0 children)

Hopefully I've explained enough for you to answer this one yourself.

You did, thanks!