- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
You must log in or register to comment.
I mean is it really a waste? What’s minimum amount of bits most CPUs read in one cycle.
In terms of memory usage it’s a waste. But in terms of performance you’re absolutely correct. It’s generally far more efficient to check is a word is 0 than to check if a single bit is zero.
Usually the most effective way is to read and write the same amount of bits as the architecture of the CPU, so for 64 bit CPUs it’s 64 bits at once.