3 ms·
The overhead due to bit masks and rotations/shifts is negligible on almost all CPUs. Larger CPUs can do many such operations during every clock cycle and even
by adrian_b 5y ago
The overhead due to bit masks and rotations/shifts is negligible on almost all CPUs.
Larger CPUs can do many such operations during every clock cycle and even in very small CPUs they are usually single-cycle operations.
Depending on the CPU, integer divisions are 10 to 100 times slower, so in a completely different range of overhead.