Like schrodinger cat Yes and No at the same time.
It depends on what you are actually doing! I once did a sudoku solver with and without a bitwise operation. Here is my benchmark:
- C: 0.9 milliseconds
- Without: 50 millis
I used the backtracking algorithm, so it explains a lot why it was much faster with bitwise processing, since sodoku is NP-Complete (possibly NP-Hard).
But, like the others that have already told you, it is very difficult to read and maintain (I will never return to my sudoku solver to make any changes, I would not understand at some point what I did).
In general, a bitwise operation is always faster than any copy, but if you do not do this by the bottle neck of critical software, I would not recommend using it without any reason other than this one.
source share